Skip to content

Add Accordion component#2

Merged
lifeiscontent merged 6 commits into
mainfrom
feat/accordion
Jun 9, 2026
Merged

Add Accordion component#2
lifeiscontent merged 6 commits into
mainfrom
feat/accordion

Conversation

@lifeiscontent

@lifeiscontent lifeiscontent commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Accordion

A new production component for @plane/propel, built on @base-ui/react/accordion (Root / Item / Header / Trigger / Panel).

API

Ergonomic compound parts:

  • Accordion: wraps Accordion.Root. Single-open by default; multiple allows several panels open. Drive with defaultValue (uncontrolled) or value + onValueChange (controlled).
  • AccordionItem: pairs a trigger with a panel (value identifies it).
  • AccordionTrigger: clickable header; renders the label plus a ChevronDown that rotates on open. Base UI sets aria-expanded / aria-controls.
  • AccordionPanel: collapsible content region; animates via Base UI's --accordion-panel-height.

No className / style props (omitted from the Base UI prop types). No styling axes; Accordion is structural and Figma only defines collapsed/hover/expanded state (handled by Base UI), not variants.

Figma

From node 1238-3101 (file ioN74zM1xMGbcPemsxs4J1): border/subtle divider, spacing/3 (p-3) padding, spacing/2 (gap-2), text/14 medium text/primary label, background/layer/transparent surface going to background/layer/transparent-hover on hover, and an icon/placeholder chevron. Mapped to propel semantic-token utilities (no arbitrary hex).

Stories

Components/Accordion, tagged ai-generated: Default (interactive), MultipleItems showcase, and an Interaction play test that clicks a trigger to expand (asserts aria-expanded flips, aria-controls/region appear) and clicks again to collapse.

Verification

  • vp check: pass (format, lint, types clean)
  • vp run -r test: 15/15 pass (Playwright chromium)
  • vp run -r build: attw No problems found (the two publint ./hooks/* warnings are pre-existing and unrelated)

Build the Accordion design-system component on @base-ui/react/accordion
(Root/Item/Header/Trigger/Panel) with an ergonomic Accordion / AccordionItem /
AccordionTrigger / AccordionPanel API.

- Trigger row mirrors Figma node 1238-3101: border-subtle divider, p-3 padding,
  gap-2, text-14 medium text-primary label, transparent surface with
  transparent-hover, icon-placeholder ChevronDown that rotates on data-[panel-open].
- Panel animates via Base UI --accordion-panel-height; relies on Base UI a11y
  (aria-expanded / aria-controls / region).
- No className/style props (Omit from Base UI types); semantic tokens only, no hex.
- Stories: Default, MultipleItems showcase, and an Interaction play test asserting
  expand/collapse and aria-expanded.
Copilot AI review requested due to automatic review settings June 8, 2026 12:57
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

📚 Storybook preview: https://pr-2-propel-storybook.vamsi-906.workers.dev

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Accordion production component to @plane/propel, implemented as ergonomic compound parts on top of @base-ui/react/accordion, and introduces Storybook stories (including a play interaction test) to demonstrate and verify behavior.

Changes:

  • Added Accordion, AccordionItem, AccordionTrigger, and AccordionPanel wrappers around Base UI primitives with Propel token-based styling.
  • Added Storybook stories under Components/Accordion, including an interaction play test for expand/collapse + ARIA behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/propel/src/components/accordion/index.tsx New Accordion compound component wrappers and styling.
packages/propel/src/components/accordion/accordion.stories.tsx New Storybook stories and interaction test for the Accordion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/propel/src/components/accordion/index.tsx Outdated
Comment thread packages/propel/src/components/accordion/index.tsx Outdated
lifeiscontent and others added 2 commits June 8, 2026 20:22
…bcomponents

The chevron sat inside AccordionTrigger but used data-[panel-open], which Base UI
sets on the trigger itself, not the icon — so it never matched. Add `group` to the
trigger and switch the chevron to `group-data-[panel-open]:rotate-180` so it rotates
when the panel is open. Also register AccordionItem/Trigger/Panel as story
subcomponents to match the avatar-group compound-component pattern.
@bhaveshraja

Copy link
Copy Markdown
Collaborator

chevron icon colour should be icon-secondary

@lifeiscontent

Copy link
Copy Markdown
Contributor Author

@bhaveshraja chevron icon now uses text-icon-secondary. c1267c6

@lifeiscontent
lifeiscontent merged commit cf741f9 into main Jun 9, 2026
2 checks passed
@lifeiscontent
lifeiscontent deleted the feat/accordion branch June 10, 2026 15:11
@lifeiscontent lifeiscontent mentioned this pull request Jun 16, 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.

3 participants