Skip to content

feat(button-group): 2nd-gen component with API, a11y, storybook, and tests#6334

Draft
Rajdeepc wants to merge 1 commit into
mainfrom
rajdeepc/feat-button-group-migration
Draft

feat(button-group): 2nd-gen component with API, a11y, storybook, and tests#6334
Rajdeepc wants to merge 1 commit into
mainfrom
rajdeepc/feat-button-group-migration

Conversation

@Rajdeepc
Copy link
Copy Markdown
Contributor

@Rajdeepc Rajdeepc commented May 25, 2026

Summary

Implements the full 2nd-gen <swc-button-group> component covering file structure, API, accessibility, Storybook documentation, and test suites.

What's included

  • Core (ButtonGroupBase): Abstract base class with orientation, align, disabled, size propagation to slotted children, role="group" semantics, and dev-mode validation warnings
  • SWC (ButtonGroup): Concrete class with S2-token-based CSS, classMap rendering for all variants
  • Storybook: Full documentation with getStorybookHelpers args table, Figma link, Stackblitz link, upcoming features section, accessibility guidance, and production vs local-only story designation
  • Tests: Storybook play-function unit tests (5 standard sections: defaults, properties, slots, variants, dev warnings) and Playwright a11y tests (ARIA snapshots, keyboard interactions, aXe validation)
  • SizedMixin: Marks _size field as @internal

Breaking changes from 1st-gen

Change 1st-gen 2nd-gen
Tag name sp-button-group swc-button-group
Orientation vertical boolean orientation="horizontal|vertical"
CSS custom properties --mod-buttongroup-* --swc-button-group-*
Default size None (noDefaultSize) m
ARIA No role set role="group" automatic

New APIs

  • align: start | center | end — main-axis alignment
  • disabled: Group-level disable propagated to children

Test plan

  • yarn build passes in both core and swc packages

  • ESLint and stylelint pass with no errors

  • Storybook renders all stories without console errors

  • Play-function tests pass via test:storybook

  • Playwright a11y tests pass via test:a11y

  • aXe reports no WCAG violations

  • Visual review in Storybook for all sizes, orientations, alignments

  • Fixes SWC 2074, SWC-2075, SWC-2076

…tests

Implements the full 2nd-gen button-group component:

- Core: ButtonGroupBase class with orientation, align, disabled, size
  propagation, role="group", and dev-mode validation warnings
- SWC: Concrete ButtonGroup with CSS (S2 tokens), classMap render
- Stories: Full Storybook documentation with all sections, Figma link,
  args table, upcoming features, and accessibility guidance
- Tests: Play-function unit tests (5 sections) and Playwright a11y
  tests (ARIA snapshots, keyboard interactions, aXe validation)
- Marks SizedMixin._size as @internal

Co-authored-by: Cursor <cursoragent@cursor.com>
@Rajdeepc Rajdeepc requested a review from a team as a code owner May 25, 2026 10:31
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

⚠️ No Changeset found

Latest commit: 7109c6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rajdeepc Rajdeepc marked this pull request as draft May 25, 2026 10:34
@github-actions
Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6334

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@Rajdeepc Rajdeepc added Status:WIP PR is a work in progress or draft do-not-merge NO MERGE-Y! labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge NO MERGE-Y! Status:WIP PR is a work in progress or draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant