Skip to content

feat: add StatTile trend indicator#166

Open
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:enhancement/stattile-trend-indicator
Open

feat: add StatTile trend indicator#166
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:enhancement/stattile-trend-indicator

Conversation

@webmirroring

Copy link
Copy Markdown

Summary

  • Adds optional delta?: number and trend?: "up" | "down" | "flat" props to StatTile.
  • Renders an accessible badge-style trend indicator (Up +N, Down -N, Flat 0) while preserving the existing <dt>/<dd> structure and unchanged default rendering.
  • Adds focused StatTile tests for no-delta, positive, negative, flat, and explicit-trend cases.
  • Documents the new props in the README accessibility section.
  • Reconnects the quote page submit handler to the existing quote validators so the frontend build stays green.

Closes #149.

Accessibility notes

The trend indicator does not rely on color alone: the visible badge includes direction text, and the badge also includes sr-only screen-reader copy.

Validation

  • node node_modules/jest/bin/jest.js src/components/__tests__/StatTile.test.tsx --runInBand passes
  • node node_modules/jest/bin/jest.js src/components/__tests__ --runInBand passes
  • node node_modules/jest/bin/jest.js --runInBand passes: 23 suites, 119 tests
  • node node_modules/typescript/bin/tsc --noEmit passes
  • node node_modules/next/dist/bin/next lint passes
  • node node_modules/next/dist/bin/next build passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an optional trend/delta indicator to the StatTile component

2 participants