Add accessible Regional Rail Fares widget (vanilla TS + Vite) with SCSS and tests #213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a small, standards-aligned fare calculator using vanilla TypeScript + Vite. Replaces CSS with SCSS structured per Sass standards. Includes unit tests (Vitest) and E2E + accessibility checks (Playwright + axe-core).
What changed
Semantic form UI (labels, fieldset/legend, aria-live output, skip link)
TS logic: load fares.json, purchase availability gating, 10-trip "Anytime" packs
SCSS modules: settings → tools → elements → components; tokens/mixins; use sass:map (map.get)
Autoprefixer via postcss.config.js
Vitest unit tests for computeTotal
Playwright E2E + axe-core a11y scan; webServer auto-starts Vite
vitest.config.ts to exclude e2e/**; updated scripts; README with run/build/test steps
Why
Keep footprint tiny while meeting accessibility, semantics, and performance goals. No framework overhead; easy to embed and test.
How to run
Dev: npm i && npm run dev
Unit tests: npm run test
E2E + a11y: npx playwright install --with-deps then npm run test:e2e
Build/preview: npm run build && npm run preview
Accessibility
Keyboard-only flow verified; visible :focus-visible
Output updates announced via aria-live
Axe scan fails on serious/critical violations