Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
"packages/devtools-utils": {
"ignoreDependencies": ["react", "solid-js", "svelte", "@types/react"],
"entry": [
"**/vite.config.solid.ts",
"**/src/solid/**",
"**/vite.config.svelte.ts",
"**/src/svelte/**"
],
"project": [
"**/vite.config.solid.ts",
"**/src/solid/**",
"**/vite.config.svelte.ts",
"**/src/svelte/**"
Expand Down
80 changes: 0 additions & 80 deletions packages/devtools-a11y/src/core/styles/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
const { color, font, gap, radius, shadow, space, type } = theme

return {
colors: { theme: themeName },
root: css`
height: 100%;
display: flex;
Expand Down Expand Up @@ -97,35 +96,11 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
flex-wrap: wrap;
justify-content: flex-end;
`,
primaryButton: css`
padding: ${theme.padding.controlBlock} ${theme.padding.controlInline};
border-radius: ${radius.control};
cursor: pointer;
`,
primaryButtonDisabled: css`
cursor: not-allowed;
opacity: 0.7;
`,
button: css`
padding: ${theme.padding.controlBlock} ${theme.padding.controlInline};
border-radius: ${radius.control};
cursor: pointer;
`,
buttonRow: css`
display: flex;
gap: ${gap.tight};
align-items: center;
`,
toggleOverlay: css`
padding: ${theme.padding.controlBlock} ${theme.padding.controlInline};
border-radius: ${radius.control};
cursor: pointer;
`,
toggleOverlayOn: css`
background: ${color.status.success.subtleFill};
color: ${color.status.success.text};
border-color: ${color.status.success.border};
`,
statusBar: css`
padding: ${space[2]} ${space[4]};
border-bottom: 1px solid ${color.border.decorative};
Expand All @@ -141,14 +116,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
statusSpacer: css`
flex: 1;
`,
smallLinkButton: css`
padding: ${space[1]} ${space[2]};
background: transparent;
color: ${color.text.link};
border: 1px solid ${color.border.control};
border-radius: ${radius.control};
cursor: pointer;
`,
content: css`
flex: 1;
overflow-y: auto;
Expand Down Expand Up @@ -274,10 +241,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
align-items: flex-start;
gap: ${gap.section};
`,
issueMain: css`
flex: 1;
min-width: 0;
`,
issueSelectButton: css`
flex: 1;
min-width: 0;
Expand Down Expand Up @@ -369,15 +332,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
border-color: ${color.state.selectionText};
}
`,
disableRule: css`
font-size: ${type.bodyXs.size};
color: ${color.text.muted};
background: none;
border: none;
cursor: pointer;
padding: 0;
font-weight: 600;
`,
tags: css`
display: flex;
gap: ${gap.tight};
Expand Down Expand Up @@ -416,11 +370,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
line-height: ${type.headingPane.lineHeight};
font-weight: 700;
`,
doneButton: css`
padding: ${theme.padding.controlBlock} ${theme.padding.controlInline};
border-radius: ${radius.control};
cursor: pointer;
`,
settingsContent: css`
flex: 1;
overflow-y: auto;
Expand All @@ -442,31 +391,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
text-transform: uppercase;
color: ${color.text.muted};
`,
settingsRow: css`
display: flex;
align-items: center;
justify-content: space-between;
padding: ${space[2]} 0;
border-bottom: 1px solid ${color.border.decorative};
gap: ${gap.section};
`,
settingsRowTitle: css`
font-size: ${type.bodySm.size};
font-weight: 500;
`,
settingsRowDesc: css`
font-size: ${type.bodyXs.size};
color: ${color.text.muted};
margin-top: 2px;
`,
select: css`
padding: ${theme.padding.controlBlock} ${theme.padding.controlInline};
border: 1px solid ${color.border.control};
border-radius: ${radius.control};
background: ${color.surface.elevated};
color: ${color.text.primary};
font-size: ${type.bodyXs.size};
`,
rulesHeaderRow: css`
display: flex;
align-items: center;
Expand All @@ -485,10 +409,6 @@ function createA11yPanelStyles(themeName: 'light' | 'dark') {
margin-bottom: ${space[3]};
flex-wrap: wrap;
`,
search: css`
flex: 1;
min-width: 180px;
`,
rulesList: css`
border: 1px solid ${color.border.decorative};
border-radius: ${radius.group};
Expand Down
60 changes: 0 additions & 60 deletions packages/devtools-a11y/src/core/utils/export-audit.uitls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,63 +118,3 @@ export function exportAuditResults(
}
}

/**
* Generate a summary report as a formatted string
*/
export function generateSummaryReport(result: A11yAuditResult): string {
const { summary } = result

const lines = [
'='.repeat(50),
'ACCESSIBILITY AUDIT REPORT',
'='.repeat(50),
'',
`URL: ${result.url}`,
`Date: ${new Date(result.timestamp).toLocaleString()}`,
`Duration: ${result.duration.toFixed(2)}ms`,
'',
'-'.repeat(50),
'SUMMARY',
'-'.repeat(50),
'',
`Total Issues: ${summary.total}`,
` - Critical: ${summary.critical}`,
` - Serious: ${summary.serious}`,
` - Moderate: ${summary.moderate}`,
` - Minor: ${summary.minor}`,
'',
`Passing Rules: ${summary.passes}`,
`Incomplete Checks: ${summary.incomplete}`,
'',
]

if (result.issues.length > 0) {
lines.push('-'.repeat(50))
lines.push('ISSUES')
lines.push('-'.repeat(50))
lines.push('')

const issuesByImpact = {
critical: result.issues.filter((i) => i.impact === 'critical'),
serious: result.issues.filter((i) => i.impact === 'serious'),
moderate: result.issues.filter((i) => i.impact === 'moderate'),
minor: result.issues.filter((i) => i.impact === 'minor'),
}

for (const [impact, issues] of Object.entries(issuesByImpact)) {
if (issues.length > 0) {
lines.push(`[${impact.toUpperCase()}]`)
for (const issue of issues) {
lines.push(` - ${issue.ruleId}: ${issue.message}`)
lines.push(` Selector: ${issue.nodes[0]?.selector}`)
lines.push(` Learn more: ${issue.helpUrl}`)
lines.push('')
}
}
}
}

lines.push('='.repeat(50))

return lines.join('\n')
}
58 changes: 0 additions & 58 deletions packages/devtools-a11y/tests/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest'
import {
exportToCsv,
exportToJson,
generateSummaryReport,
} from '../src/core/utils/export-audit.uitls'

// types
Expand Down Expand Up @@ -149,61 +148,4 @@ describe('export', () => {
expect(csv).toContain('wcag2a; wcag111')
})
})

describe('generateSummaryReport', () => {
it('should generate a human-readable summary', () => {
const result = createMockResult()
const report = generateSummaryReport(result)

expect(report).toContain('ACCESSIBILITY AUDIT REPORT')
expect(report).toContain('URL: http://localhost:3000/')
expect(report).toContain('Total Issues: 2')
expect(report).toContain('Critical: 1')
expect(report).toContain('Serious: 1')
expect(report).toContain('Passing Rules: 50')
})

it('should group issues by impact', () => {
const result = createMockResult()
const report = generateSummaryReport(result)

expect(report).toContain('[CRITICAL]')
expect(report).toContain('[SERIOUS]')
expect(report).toContain('image-alt')
expect(report).toContain('button-name')
})

it('should include selector and help URL', () => {
const result = createMockResult()
const report = generateSummaryReport(result)

expect(report).toContain('Selector: img.logo')
expect(report).toContain('Learn more: https://dequeuniversity.com')
})

it('should handle result with no issues', () => {
const result: A11yAuditResult = {
issues: [],
summary: {
total: 0,
critical: 0,
serious: 0,
moderate: 0,
minor: 0,
passes: 50,
incomplete: 0,
},
timestamp: 1704067200000,
url: 'http://localhost:3000/',
context: 'document',
duration: 50,
}

const report = generateSummaryReport(result)

expect(report).toContain('Total Issues: 0')
expect(report).not.toContain('[CRITICAL]')
expect(report).not.toContain('[SERIOUS]')
})
})
})
90 changes: 0 additions & 90 deletions packages/devtools-ui/src/styles/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,56 +159,6 @@ export const tokens = {
10: '1a',
0: '00',
},
font: {
size: {
'2xs': 'calc(var(--tsrd-font-size) * 0.625)',
xs: 'calc(var(--tsrd-font-size) * 0.75)',
sm: 'calc(var(--tsrd-font-size) * 0.875)',
md: 'var(--tsrd-font-size)',
lg: 'calc(var(--tsrd-font-size) * 1.125)',
xl: 'calc(var(--tsrd-font-size) * 1.25)',
'2xl': 'calc(var(--tsrd-font-size) * 1.5)',
'3xl': 'calc(var(--tsrd-font-size) * 1.875)',
'4xl': 'calc(var(--tsrd-font-size) * 2.25)',
'5xl': 'calc(var(--tsrd-font-size) * 3)',
'6xl': 'calc(var(--tsrd-font-size) * 3.75)',
'7xl': 'calc(var(--tsrd-font-size) * 4.5)',
'8xl': 'calc(var(--tsrd-font-size) * 6)',
'9xl': 'calc(var(--tsrd-font-size) * 8)',
},
lineHeight: {
'3xs': 'calc(var(--tsrd-font-size) * 0.75)',
'2xs': 'calc(var(--tsrd-font-size) * 0.875)',
xs: 'calc(var(--tsrd-font-size) * 1)',
sm: 'calc(var(--tsrd-font-size) * 1.25)',
md: 'calc(var(--tsrd-font-size) * 1.5)',
lg: 'calc(var(--tsrd-font-size) * 1.75)',
xl: 'calc(var(--tsrd-font-size) * 2)',
'2xl': 'calc(var(--tsrd-font-size) * 2.25)',
'3xl': 'calc(var(--tsrd-font-size) * 2.5)',
'4xl': 'calc(var(--tsrd-font-size) * 2.75)',
'5xl': 'calc(var(--tsrd-font-size) * 3)',
'6xl': 'calc(var(--tsrd-font-size) * 3.25)',
'7xl': 'calc(var(--tsrd-font-size) * 3.5)',
'8xl': 'calc(var(--tsrd-font-size) * 3.75)',
'9xl': 'calc(var(--tsrd-font-size) * 4)',
},
weight: {
thin: '100',
extralight: '200',
light: '300',
normal: '400',
medium: '500',
semibold: '600',
bold: '700',
extrabold: '800',
black: '900',
},
fontFamily: {
sans: 'ui-sans-serif, Inter, system-ui, sans-serif, sans-serif',
mono: `ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`,
},
},
breakpoints: {
xs: '320px',
sm: '640px',
Expand All @@ -230,46 +180,6 @@ export const tokens = {
full: '9999px',
},
},
size: {
0: '0px',
0.25: 'calc(var(--tsrd-font-size) * 0.0625)',
0.5: 'calc(var(--tsrd-font-size) * 0.125)',
1: 'calc(var(--tsrd-font-size) * 0.25)',
1.5: 'calc(var(--tsrd-font-size) * 0.375)',
2: 'calc(var(--tsrd-font-size) * 0.5)',
2.5: 'calc(var(--tsrd-font-size) * 0.625)',
3: 'calc(var(--tsrd-font-size) * 0.75)',
3.5: 'calc(var(--tsrd-font-size) * 0.875)',
4: 'calc(var(--tsrd-font-size) * 1)',
4.5: 'calc(var(--tsrd-font-size) * 1.125)',
5: 'calc(var(--tsrd-font-size) * 1.25)',
5.5: 'calc(var(--tsrd-font-size) * 1.375)',
6: 'calc(var(--tsrd-font-size) * 1.5)',
6.5: 'calc(var(--tsrd-font-size) * 1.625)',
7: 'calc(var(--tsrd-font-size) * 1.75)',
8: 'calc(var(--tsrd-font-size) * 2)',
9: 'calc(var(--tsrd-font-size) * 2.25)',
10: 'calc(var(--tsrd-font-size) * 2.5)',
11: 'calc(var(--tsrd-font-size) * 2.75)',
12: 'calc(var(--tsrd-font-size) * 3)',
14: 'calc(var(--tsrd-font-size) * 3.5)',
16: 'calc(var(--tsrd-font-size) * 4)',
20: 'calc(var(--tsrd-font-size) * 5)',
24: 'calc(var(--tsrd-font-size) * 6)',
28: 'calc(var(--tsrd-font-size) * 7)',
32: 'calc(var(--tsrd-font-size) * 8)',
36: 'calc(var(--tsrd-font-size) * 9)',
40: 'calc(var(--tsrd-font-size) * 10)',
44: 'calc(var(--tsrd-font-size) * 11)',
48: 'calc(var(--tsrd-font-size) * 12)',
52: 'calc(var(--tsrd-font-size) * 13)',
56: 'calc(var(--tsrd-font-size) * 14)',
60: 'calc(var(--tsrd-font-size) * 15)',
64: 'calc(var(--tsrd-font-size) * 16)',
72: 'calc(var(--tsrd-font-size) * 18)',
80: 'calc(var(--tsrd-font-size) * 20)',
96: 'calc(var(--tsrd-font-size) * 24)',
},
shadow: {
xs: (_: string = 'rgb(0 0 0 / 0.1)') =>
`0 1px 2px 0 rgb(0 0 0 / 0.05)` as const,
Expand Down
Loading