Skip to content

feat(react): implement reusable and accessible modal component (#227)#385

Open
iamTissan wants to merge 1 commit into
BCPathway:mainfrom
iamTissan:feature/issue-227-modal
Open

feat(react): implement reusable and accessible modal component (#227)#385
iamTissan wants to merge 1 commit into
BCPathway:mainfrom
iamTissan:feature/issue-227-modal

Conversation

@iamTissan

Copy link
Copy Markdown

What does this PR do?

Introduces a modular, fully accessible (a11y), and responsive native React Modal component inside the @bc-forge/react library package.

Key implementation details include:

  • Accessibility Foundations: Built using native ARIA attributes (role="dialog", aria-modal="true", aria-labelledby) conforming to WCAG standards.
  • Keyboard Navigation: Implements an active keyboard focus trap using custom vanilla React hooks to lock focus context sequentially within active modal elements, alongside native Escape key dismissal support.
  • Design Tokens: Configured with robust structure variants (sm, md, lg) and responsive tailwind frame wrapping layout support, including context borders for variant states (e.g., danger).
  • State Cleanup: Auto-restores the previously focused element upon unmounting and isolates underlying frame scrolling via body locking configurations.
  • Test Coverage: Added comprehensive test suites verifying conditional viewport rendering, backdrop wrapper event bubbling/isolation, escape trigger captures, and custom child focus constraints.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • CI
  • Chore

Checklist

  • I ran pre-commit run --all-files locally and it passed
  • All CI jobs pass on this branch
  • I added or updated tests for new behaviour
  • I updated relevant docs / comments
  • No secrets or credentials are included
  • No breaking changes to public APIs (or I've documented them)

Breaking changes?

No.

Related issues

Closes #227

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@iamTissan Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Frontend: Implement Reusable Modal Component

1 participant