Skip to content

Refactor AccordionItem to work standalone without Accordion wrapper#737

Closed
nourmalaeb wants to merge 1 commit intodevfrom
collapsible-component
Closed

Refactor AccordionItem to work standalone without Accordion wrapper#737
nourmalaeb wants to merge 1 commit intodevfrom
collapsible-component

Conversation

@nourmalaeb
Copy link
Collaborator

@nourmalaeb nourmalaeb commented Mar 10, 2026

Summary

  • Refactor AccordionItem to own its own variant prop ('default' | 'unstyled') and provide style context to children, so it works standalone without an <Accordion> wrapper
  • Accordion becomes a thin layout wrapper (flex flex-col gap-3 + DisclosureGroup behavior) — no longer sets style context
  • Remove root slot from accordionStyles (layout is baked directly into Accordion)
  • Delete collapsible.tsx and Collapsible.stories.tsx — no longer needed since AccordionItem serves this purpose
  • Migrate existing variant="unstyled" usage from <Accordion> to <AccordionItem> in PhasesSectionContent, RubricEditorContent, and Storybook stories
  • Remove ./Collapsible export from @op/ui package.json

Test plan

  • pnpm typecheck passes
  • pnpm format:check passes
  • Existing Accordion behavior unchanged (RubricEditorContent, PhasesSectionContent)
  • Storybook visual check: Default, MultipleExpanded, Unstyled, CustomHeader stories all render correctly
  • Standalone <AccordionItem> works without <Accordion> parent

…se on top

Create Collapsible, CollapsibleTrigger, and CollapsibleContent as standalone
primitives wrapping React Aria's Disclosure. The height animation logic is
extracted from AccordionContent into CollapsibleContent so it can be reused
independently. Accordion components now compose on top of Collapsible,
preserving all existing behavior.
@vercel
Copy link
Contributor

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview Mar 10, 2026 0:34am

Request Review

@nourmalaeb nourmalaeb changed the title Add standalone Collapsible primitives and refactor Accordion Refactor AccordionItem to work standalone without Accordion wrapper Mar 10, 2026
@nourmalaeb
Copy link
Collaborator Author

Work consolidated into #738 (rebased onto dev directly).

@nourmalaeb nourmalaeb closed this Mar 10, 2026
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.

1 participant