Skip to content

chore: Styling v2 for button dropdown and button group - #5187

Merged
pan-kot merged 3 commits into
mainfrom
chore-style-api-button-dropdown-group
Oct 28, 2026
Merged

pan-kot merged 3 commits into
mainfrom
chore-style-api-button-dropdown-group

Conversation

@pan-kot

@pan-kot pan-kot commented Oct 26, 2026

Copy link
Copy Markdown
Member

Description

New APIs are reflected in the tracker: P3d34KdbCd6o.

How has this been tested?

Unit tests and test pages

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (a9a2cb1) to head (4f3b7b3).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5187      +/-   ##
==========================================
- Coverage   97.73%   97.73%   -0.01%     
==========================================
  Files         996      998       +2     
  Lines       32219    32252      +33     
  Branches    11906    11924      +18     
==========================================
+ Hits        31490    31522      +32     
+ Misses        723      685      -38     
- Partials        6       45      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Upload focus rings ignore the new styling tokens, and the committed Style API documentation snapshots need updating.

2 open issues
What changed in this PR

Extends Style API v2 support to ButtonDropdown, ButtonGroup, and Divider, reusing the existing button and dropdown styling infrastructure.

Changes:

  • Adds styling slots and forwards classes through button-group item types.
  • Adds divider tokens and renames the internal dropdown slot to container.
  • Adds slot-forwarding tests and styling demo pages.
File Description
src/​toggle-button/​internal.tsx Forwards button styling classes.
src/​internal/​styles/​style-api.scss Makes the documentation forwarding slot optional.
src/​file-input/​internal.tsx Forwards styling classes to the upload button.
src/​dropdown/​styles.scss Renames the documented slot to container.
src/​dropdown/​internal.tsx Applies the renamed container slot.
src/​dropdown/​__tests__/​style-api.test.tsx Updates tests for the container slot.
src/​divider/​styles.scss Adds line-color and line-width tokens.
src/​divider/​internal.tsx Applies the root styling class.
src/​divider/​index.tsx Forwards root styling configuration.
src/​divider/​__tests__/​style-api.test.tsx Tests root classes and DOM prop filtering.
src/​button-group/​styles.scss Adds divider tokens and forwarded slot documentation.
src/​button-group/​menu-dropdown-item.tsx Styles menu triggers and panels.
src/​button-group/​item-element.tsx Resolves item classes and distributes styling slots.
src/​button-group/​internal.tsx Forwards slots and styles dividers.
src/​button-group/​internal-interfaces.ts Defines group styling slots.
src/​button-group/​index.tsx Forwards styling configuration.
src/​button-group/​icon-toggle-button-item.tsx Forwards toggle-button styling.
src/​button-group/​icon-button-item.tsx Forwards icon-button styling.
src/​button-group/​file-input-item.tsx Forwards upload-button styling.
src/​button-group/​copy-to-clipboard-item.tsx Forwards copy-button styling.
src/​button-group/​__tests__/​style-api.test.tsx Tests item callbacks and styling slots.
src/​button-dropdown/​styles.scss Documents forwarded button and panel slots.
src/​button-dropdown/​internal.tsx Applies trigger, main-action, and panel classes.
src/​button-dropdown/​internal-interfaces.ts Defines dropdown styling slots.
src/​button-dropdown/​index.tsx Forwards styling configuration.
src/​button-dropdown/​__tests__/​style-api.test.tsx Tests standard and split-button slots.
pages/​dropdown/​style-api-v2.scss Uses the renamed container mixin.
pages/​dropdown/​style-api-v2.page.tsx Uses the renamed container slot.
pages/​divider/​style-api-v2.scss Defines divider styling examples.
pages/​divider/​style-api-v2.page.tsx Demonstrates labeled and oriented dividers.
pages/​button-group/​style-api-v2.scss Defines item, divider, and menu styles.
pages/​button-group/​style-api-v2.page.tsx Demonstrates styling across item types.
pages/​button-dropdown/​style-api-v2.scss Defines trigger and panel styles.
pages/​button-dropdown/​style-api-v2.page.tsx Demonstrates standard, split, and icon variants.

Review effort: Balanced

Comment thread src/dropdown/styles.scss Resolved
Comment thread src/file-input/internal.tsx Resolved
Comment on lines +13 to +14
<Divider {...({ styleClassNames: { root: 'a', unknown: 'b' } } as any)} />
<Divider {...({ styleClassNames: { root: 'c' } } as any)}>Label</Divider>

@SpyZzey SpyZzey Oct 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Should we rename the classes to be more descriptive, e.g., plain-root, labelled-root, unknown-key (Same things in the other tests)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd keep it a/b/c to be honest - as we consistently use it in many other similar tests already - this includes 9 already merged components and 10+ not merged ones.


export default function () {
const [pinned, setPinned] = useState(false);
const items: ButtonGroupProps.ItemOrGroup[] = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Should we move this out to the file itself, not the function? Similar to how we do it in the button-dropdown to be consistent? Same for the styleClassNames

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We cannot move items in this case because it depends on state (pinned). I will apply the change to styleClassNames.

@pan-kot
pan-kot requested a balanced review from Copilot October 27, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

5 open issues
2 resolved since last review

Review effort: Lite

Comment thread src/divider/index.tsx Resolved
Comment thread src/button-dropdown/index.tsx Resolved
Comment thread src/button-group/index.tsx Resolved
@pan-kot
pan-kot added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 27, 2026
@pan-kot
pan-kot added this pull request to the merge queue Oct 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 28, 2026
@pan-kot
pan-kot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit c011fbc Oct 28, 2026
68 of 69 checks passed
@pan-kot
pan-kot deleted the chore-style-api-button-dropdown-group branch October 28, 2026 10:31

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 4f3b7b3f Deployed Oct 27, 2026 by pan-kot via deploy (React 18) / deploy #2991
dev-pages-react16 — 4f3b7b3f Deployed Oct 27, 2026 by pan-kot via deploy (React 16) / deploy #2991
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