Skip to content

feat: implement Accordion component with Registration System#563

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
pugsley76:feat/accordion-registration-system
May 29, 2026
Merged

feat: implement Accordion component with Registration System#563
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
pugsley76:feat/accordion-registration-system

Conversation

@pugsley76
Copy link
Copy Markdown

closes #471

Summary

Implements a fully-featured Accordion component with a context-based
Registration System, where each AccordionItem registers/unregisters
itself with the root on mount/unmount.

Changes

  • Add Accordion, AccordionItem, AccordionTrigger, AccordionContent
  • Registration system via a Map registry in the root — enables
    cross-item coordination (exclusive mode, programmatic control, safe
    dynamic unmounting)
  • Uncontrolled mode (defaultOpenIds) and controlled mode (openIds + onOpenChange)
  • Exclusive mode (exclusive prop) — only one item open at a time
  • Disabled items block toggling
  • Variants: default, bordered, ghost
  • Sizes: sm, md, lg
  • Full accessibility: aria-expanded, aria-controls, role="region",
    aria-labelledby, keyboard activation (Enter / Space)
  • 37 unit & integration tests covering all behaviours
  • Registered in src/components/index.ts barrel export

Testing

All 37 tests pass. No regressions in existing test suite.

Acceptance Criteria

  • Accordion properly implements Registration System
  • All related tests pass
  • No regression in existing functionality
  • Code follows project coding standards
  • Accessibility guidelines followed
  • Performance impact is minimal

- Add Accordion, AccordionItem, AccordionTrigger, AccordionContent
- Registration system: each AccordionItem registers/unregisters with
  the root via a Map registry, enabling cross-item coordination
- Support uncontrolled (defaultOpenIds) and controlled (openIds +
  onOpenChange) modes
- Exclusive mode (exclusive prop) closes other items on open
- Disabled items block toggling
- Variants: default, bordered, ghost
- Sizes: sm, md, lg
- Full ARIA support: aria-expanded, aria-controls, role=region,
  aria-labelledby, keyboard activation
- 37 unit/integration tests covering all behaviours
- Register exports in src/components/index.ts barrel
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@pugsley76 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

@RUKAYAT-CODER RUKAYAT-CODER merged commit 41aa13d into rinafcode:main May 29, 2026
1 check passed
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.

refactor Accordion Component : Registration System

2 participants