Skip to content

feat(close-button): migrate to 2nd-gen#6410

Open
TarunAdobe wants to merge 14 commits into
mainfrom
ttomar/close-button-migration
Open

feat(close-button): migrate to 2nd-gen#6410
TarunAdobe wants to merge 14 commits into
mainfrom
ttomar/close-button-migration

Conversation

@TarunAdobe

Copy link
Copy Markdown
Contributor

Description

Completes the 2nd-gen migration of Close Button (Epic SWC-2087) by landing the full stacked workstream
on main:

Merged PR Phase
#6355 Scaffold — component structure, ButtonBase reuse, cross icons, exports
#6360 API + accessibility — public surface, Storybook contract tests
#6385 S2 styling + Storybook docs + consumer migration guide
#6405 Playwright a11y snapshots + keyboard coverage

SWC (2nd-gen/packages/swc/components/close-button/)

  • CloseButton — extends ButtonBase; native inner <button type="button"> with delegated focus;
    cross icon per size (s | m | l | xl)
  • Public API: size, static-color, accessible-label, disabled
  • close-button.css — Spectrum 2 close-button visuals (size/static-color states, border + outline
    focus, press perspective transform, aligned with 2nd-gen button interaction patterns)
  • Storybook — Playground, Overview, Anatomy, Sizes, Static colors, States, Accessibility + Close Button/Tests interaction suite
  • Docsclose-button.mdx, migration-guide.mdx
  • Tests — Storybook interaction tests + close-button.a11y.spec.ts (ARIA snapshots + tab-focus)

Core / shared

  • ButtonBasestatic-color on shared button base; DEBUG validation for invalid static-color and
    missing accessible-label on icon-only controls (inherited by close-button)
  • Cross iconsCross400Icon, Cross500Icon for l / xl sizes

Breaking changes (1st-gen → 2nd-gen)

Change Migration
Tag <sp-close-button><swc-close-button>
Accessible name labelaccessible-label (or default slot text)
Static color variant="white|black" not supported — use static-color only
CSS overrides --mod-closebutton-* → reviewed --swc-close-button-*
sp-close-button in 1st-gen is unchanged in this PR.

Motivation and context

Close button is a compact dismiss affordance used across dialogs, toasts, banners, and action bars. This PR delivers the full washing-machine migration: API contract, S2 visual parity, accessibility behavior, automated test coverage, and consumer-facing migration docs — bringing swc-close-button to the same standard as other migrated 2nd-gen components.

Related issue(s)

  • SWC-2087 (epic — close-button 2nd-gen migration)
  • SWC-2089 (planning)

Screenshots (if appropriate)

2nd-gen Storybook → Close Button → Docs — verify Anatomy, Sizes, Static colors, States, and Accessibility. Also review Close Button / Migration guide.

Author's checklist

  • I have read the
    CONTRIBUTING and
    PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published. (Add @adobe/spectrum-wc patch changeset before merge.)
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash (if 2nd-gen VR runs for this component)

Manual review test cases

  • Storybook docs and visuals
    1. Open 2nd-gen Storybook → Close Button → Docs.
    2. Walk Anatomy, Sizes, Static colors (white on dark / black on light), States, Accessibility.
    3. Confirm S2 hit target, hover/active press, keyboard focus ring, and static-color treatments look
      correct.
  • Public API (CEM / controls)
    1. Close Button → Playground.
    2. Confirm controls: size, static-color, accessible-label, disabled.
    3. Confirm no variant on swc-close-button.
  • Accessible name
    1. Close Button → Tests → Overview Test — accessible-label → inner aria-label.
    2. Slot Label / Accessible Label Precedence tests — slot vs accessible-label precedence.
    3. DEBUG: missing accessible-label on icon-only instance warns in dev.
  • Automated tests
    1. yarn workspace @adobe/spectrum-wc test -- --run --project storybook components/close-button
    2. yarn workspace @adobe/spectrum-wc playwright test components/close-button/test/close-button.a11y.spec.ts - project=chromium
    3. Expect all green.
  • Consumer migration guide
    1. Close Button → Migration guide.
    2. Spot-check tag rename, accessible-label, dropping variant, and --swc-close-button-* custom properties.

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard
    1. Close Button → Overview — Tab lands on inner button (delegated focus); visible focus ring on :focus-visible.
    2. Enter / Space activate the dismiss control.
    3. States story — disabled instance skipped in tab order; not activatable.
    4. Static colors / dialog chrome examples — focus and activation work on each variant.
  • Screen reader
    1. Overview with accessible-label="Close" — announced as button, name "Close".
    2. Accessibility story — slot-only "Dismiss", dialog chrome "Close dialog", disabled "Close" with disabled state.
    3. Cross icon must not duplicate the name (aria-hidden="true" on icon wrapper).

Notes for reviewers

  • pending / pending-label in API table — inherited from ButtonBase; close-button does not implement pending visuals. Expected to clear when pending moves off ButtonBase (separate button workstream).
  • 01_status.md — update Close Button row on merge if not included in this PR.

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a20470

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@adobe/spectrum-wc Minor
@spectrum-web-components/core Minor

Not sure what this means? Click here to learn what changesets are.

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

@TarunAdobe TarunAdobe changed the title Ttomar/close button migration feat(close-button): migrate swc-close-button to 2nd-gen Jun 16, 2026
@TarunAdobe TarunAdobe marked this pull request as ready for review June 16, 2026 11:58
@TarunAdobe TarunAdobe requested a review from a team as a code owner June 16, 2026 11:58
@TarunAdobe TarunAdobe self-assigned this Jun 16, 2026
@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 4b96756 to 49359cc Compare June 16, 2026 11:59
@github-actions

github-actions Bot commented Jun 16, 2026

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-6410

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.

@nikkimk nikkimk 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.

In addition to the linting error, I think we should look at removing the default slot. The default slot is used for visual labels and there is never a visible label (only an accessible one) on the close button.

${crossIconBySize[this.size]()}
</span>
<span class="swc-CloseButton-label">
<slot></slot>

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.

Since the slotted label is never visible, and we already have accessible-label, we should probably just remove the slotted label, and update docs stories and tests accordingly.

Suggested change
<slot></slot>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’ve removed the slot and label span from the render tree, dropped the .swc-CloseButton-label styles, and updated getResolvedAccessibleName() so accessible-label is the only naming channel (light DOM text is ignored). Stories, docs, migration guide, unit tests, and Playwright a11y snapshots are updated accordingly.

Also fixed the lint issues.

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.

The default slot is still showing up on the API page.

@pfulton pfulton added Status:Ready for review PR ready for review or re-review. and removed ready-for-review labels Jun 16, 2026
@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 6f61eb9 to 1b96e38 Compare June 17, 2026 06:30
@TarunAdobe TarunAdobe requested a review from nikkimk June 17, 2026 06:31

@5t3ph 5t3ph 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.

Please ask the agent to run the code conformance rule prior to these changes - it will hopefully catch some of the things I noted for CSS, let me know if it doesn't at least do the rule re-ordering for you!

* decorative (`aria-hidden="true"`).
*
* @element swc-close-button
* @since 0.0.1

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.

Suggested change
* @since 0.0.1
* @since 2.0.0

- **Large (`l`)** — larger hit target when space allows
- **Extra large (`xl`)** — maximum visibility for prominent dismiss controls

> **Migration note:** `<swc-close-button>` reflects **`size="m"`** on the host when omitted. Spectrum 1 did not reflect a default `size` attribute, though the visual default was still medium.

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.

Remove all migration notes - any of this type of information belongs in the consumer migration guide only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

box-sizing: border-box;
}

:host([size="s"]) {

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.

[nit] re-order these t-shirt sizes and other variants to the end of the file per our rule order

transition-property: outline, border-color, color, background-color, transform;
}

.swc-CloseButton:focus {

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.

Remove, unneeded

--swc-close-button-icon-color-hover: token("transparent-black-900");
}

.swc-CloseButton {

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.

There is a transition error for the outline color on :focus-visible (previously mitigated with action button as well) that is resolved by splitting up the outline properties in this way (keep your tokens, simplified for example):

button {
	transition: outline-color 300ms ease-in;
	outline-offset: 2px;
	outline: 0px solid transparent;
}

button:focus-visible {
	outline-width: 2px;
	outline-color: blue;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One additional recommendation I might make for outline styling, to align more with button-base.css, if you set a transparent border or outline it will automatically become visible when in forced-colors/WHCM mode, even when not focused:

Image

To avoid that, button sets outlines only for :focus-visible, like this:

.swc-Button {
  /* no outline styles here */
}

.swc-Button:focus-visible {
  outline: token("focus-indicator-thickness") solid var(--swc-button-focus-indicator-color, token("focus-indicator-color"));
  outline-offset: token("focus-indicator-gap");
}

I think we could implement that here, unless there is a reason that we would want the double outline.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@5t3ph explained the outline error to me more and I'd recommend a tiny adjustment to avoid issues with transition (see SWC-2308):

.swc-CloseButton {
    outline: outline: 0px solid transparent;
}

outline-offset: var(--swc-close-button-focus-indicator-gap, token("focus-indicator-gap"));
}

.swc-CloseButton:hover:not(:disabled) {

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.

This increases the specificity more than we'd like (same for :active).

Instead, borrow the pattern from button-base.css and remove the inflation here to exclude disabled and replace the current :disabled selector with .swc-CloseButton:disabled:is(*, :hover)

block-size: 100%;
}

.swc-CloseButton-icon svg path {

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.

[nit] this should be inherited if placed on svg - if it is not, there may be a fill property within the icon SVG that shouldn't be there.

@5t3ph

5t3ph commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Reminder to add the run_vrt label and approve the baselines before merge

Comment on lines 38 to 39
* @slot - Visible button label.
* @slot icon - Optional leading icon.

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.

Since base does not include the render, slot JS docs should probably move to the component classes. Not all buttons will have a default slot (close button, clear button, and infield button do not have it) and now all buttons have an icon slot, and it shows up in close button's API.

Suggested change
* @slot - Visible button label.
* @slot icon - Optional leading icon.

@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 9991067 to d0a30da Compare June 18, 2026 10:34
@TarunAdobe TarunAdobe added the run_vrt Triggers the Chromatic VRT run for 2nd-gen label Jun 18, 2026

@rise-erpelding rise-erpelding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This will also need a changeset!

--swc-close-button-icon-color-hover: token("transparent-black-900");
}

.swc-CloseButton {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One additional recommendation I might make for outline styling, to align more with button-base.css, if you set a transparent border or outline it will automatically become visible when in forced-colors/WHCM mode, even when not focused:

Image

To avoid that, button sets outlines only for :focus-visible, like this:

.swc-Button {
  /* no outline styles here */
}

.swc-Button:focus-visible {
  outline: token("focus-indicator-thickness") solid var(--swc-button-focus-indicator-color, token("focus-indicator-color"));
  outline-offset: token("focus-indicator-gap");
}

I think we could implement that here, unless there is a reason that we would want the double outline.

Comment thread 2nd-gen/packages/swc/components/close-button/stories/close-button.stories.ts Outdated
Comment thread 2nd-gen/packages/swc/components/close-button/stories/close-button.stories.ts Outdated
Comment thread 2nd-gen/packages/swc/components/close-button/close-button.mdx Outdated
@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from d0a30da to 0d8fdab Compare June 19, 2026 06:41
@TarunAdobe

Copy link
Copy Markdown
Contributor Author

Thank you @rise-erpelding for a thorough review. I have addressed these:

  • added the changeset
  • fixed the skipped heading level in the MDX docs
  • added !test to the static-colors story
  • removed the unnecessary story wrappers where the default canvas layout was enough
  • updated the close-button migration plan checklist/status items

@coveralls

coveralls commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28227431428

Coverage increased (+0.007%) to 96.246%

Details

  • Coverage increased (+0.007%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39173
Covered Lines: 37902
Line Coverage: 96.76%
Relevant Branches: 6460
Covered Branches: 6018
Branch Coverage: 93.16%
Branches in Coverage %: Yes
Coverage Strength: 459.12 hits per line

💛 - Coveralls

@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 16df1ab to 4347e04 Compare June 22, 2026 07:09
user-select: none;
transition-timing-function: token("animation-ease-in-out");
transition-duration: token("animation-duration-100");
transition-property: border-color, color, background-color, transform;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
transition-property: border-color, color, background-color, transform;
transition-property: outline, border-color, color, background-color, transform;

--swc-close-button-icon-color-hover: token("transparent-black-900");
}

.swc-CloseButton {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@5t3ph explained the outline error to me more and I'd recommend a tiny adjustment to avoid issues with transition (see SWC-2308):

.swc-CloseButton {
    outline: outline: 0px solid transparent;
}

- [ ] Lint/tests/build pass.
- [ ] Status doc updated.
- [ ] Changeset included.
- [x] Status doc updated.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude has informed me that we still need to update 01_status.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

your claude is smarter than my claude lol

@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 3d51ec1 to 48b9a83 Compare June 23, 2026 08:47

@5t3ph 5t3ph 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.

A few last documentation suggestions.

Comment on lines +17 to +21
### Properties

- **`accessible-label`** — required accessible name forwarded to the inner button as `aria-label`
- **`size`** — visual size of the hit target and icon scale (`s`, `m`, `l`, `xl`)
- **`static-color`** — static color treatment for display over colored or image backgrounds (`white`, `black`)

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.

Remove - these are documented through the other story examples plus the API table

Suggested change
### Properties
- **`accessible-label`** — required accessible name forwarded to the inner button as `aria-label`
- **`size`** — visual size of the hit target and icon scale (`s`, `m`, `l`, `xl`)
- **`static-color`** — static color treatment for display over colored or image backgrounds (`white`, `black`)

Comment on lines +31 to +34
- **Small (`s`)** — compact chrome such as dense toolbars or inline banners
- **Medium (`m`)** — default size for dialogs, toasts, and most dismiss affordances
- **Large (`l`)** — larger hit target when space allows
- **Extra large (`xl`)** — maximum visibility for prominent dismiss controls

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.

Are these from our design guidelines, or invented by your agent? 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

100% hallucinated but looked okay so i let it be... I'll remove this extra guidance lol

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.

double agent. be careful

- **white** — use on dark or colored backgrounds for better contrast
- **black** — use on light backgrounds for better contrast

The canvas below uses the Storybook static-color demo layout: **white** on a dark gradient panel and **black** on a light gradient panel.

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.

Implementation detail, remove.

Suggested change
The canvas below uses the Storybook static-color demo layout: **white** on a dark gradient panel and **black** on a light gradient panel.

@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from a6eca21 to c20992c Compare June 24, 2026 06:59
@TarunAdobe TarunAdobe requested a review from 5t3ph June 24, 2026 06:59
@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from c20992c to 1b53a3b Compare June 25, 2026 06:07
@Rajdeepc Rajdeepc changed the title feat(close-button): migrate swc-close-button to 2nd-gen feat(close-button): migrate to 2nd-gen Jun 25, 2026

@5t3ph 5t3ph 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.

A few last questions on the updates to Button base

* @internal
*/
protected getResolvedAccessibleName(): string | null {
public getResolvedAccessibleName(): string | null {

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.

It looks like you still ended up writing a custom function, so does this still need to be made public?

*/
protected readonly handleClick = (event: Event): void => {
if (this.disabled || this.pending) {
protected handleActivationClick(event: Event): void {

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.

What was the reasoning for this extra distinction of handleActivationClick vs. handeClick? Was this used in an earlier iteration then changed?

Also, why was the || this.pending clause removed/added as an else if? Pending does also need to prevent additional interaction.

* Static color treatment for display over colored or image backgrounds.
*/
@property({ type: String, reflect: true, attribute: 'static-color' })
public staticColor?: ButtonStaticColor;

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.

Clear and In-field buttons will not need static colors, so are we sure we want to move this to base?

Rajdeepc pushed a commit that referenced this pull request Jun 25, 2026
- S3: clarify that standalone use retains its own focus-visible ring; the
  outline:none suppression applies only in composed field contexts
- Drop 'active' from public API: not in ButtonBase; :active CSS handles
  pressed visual; no toggle use case in-field
- Drop 'type' from public API: not in ButtonBase; concrete template hardcodes
  type="button"; submit/reset deferred to A3
- static-color: add note that if ButtonBase gains staticColor (PR #6410),
  swc-infield-button must explicitly exclude it
- Default slot: fix wording — slots are in the concrete template, not
  provided by ButtonBase (which has no render method)
- Render template: replace BEM modifier classMap with attribute selectors;
  quiet and size are reflected so :host([quiet]) / :host([size="s"]) apply
- Remove fill wrapper div from template; add Phase 5 note to verify whether
  the wrapper is required or ::slotted() alone is sufficient

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rajdeepc pushed a commit that referenced this pull request Jun 25, 2026
- S3: clarify that standalone use retains its own focus-visible ring; the
  outline:none suppression applies only in composed field contexts
- Drop 'active' from public API: not in ButtonBase; :active CSS handles
  pressed visual; no toggle use case in-field
- Drop 'type' from public API: not in ButtonBase; concrete template hardcodes
  type="button"; submit/reset deferred to A3
- static-color: add note that if ButtonBase gains staticColor (PR #6410),
  swc-infield-button must explicitly exclude it
- Default slot: fix wording — slots are in the concrete template, not
  provided by ButtonBase (which has no render method)
- Render template: replace BEM modifier classMap with attribute selectors;
  quiet and size are reflected so :host([quiet]) / :host([size="s"]) apply
- Remove fill wrapper div from template; add Phase 5 note to verify whether
  the wrapper is required or ::slotted() alone is sufficient

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TarunAdobe and others added 13 commits June 26, 2026 12:25
* chore(close-button): add Cross400 and Cross500 icons

Add cross icon assets required for close-button l and xl sizes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(close-button): phase 2 swc scaffold

Add swc-close-button with minimal render, CSS, Storybook stories, and tests
for the phase 2 setup milestone.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(button): move static-color to ButtonBase and harden disabled clicks

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(close-button): phase 3–4 API stories, tests, and migration plan

Rebase onto close-button-migration after scaffold merge. Close-button
extends ButtonBase directly (no CloseButtonBase); hide inherited pending
controls in Storybook.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(close-button): use BUTTON_* constants from core in stories

Drop redundant CloseButton.VALID_SIZES and STATIC_COLORS aliases; close-button
shares the button size and static-color scale via ButtonBase.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(close-button): stop hiding pending controls in Storybook

Inherited ButtonBase pending attributes are fine until pending moves off
ButtonBase; update migration plan to match.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(close-button): address API PR review feedback

Use template() for the slot-label Accessibility story example and add a
render-time test that accessible-label wins over slot text.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(close-button): migrate S2 styling and focus treatment

Port spectrum-two close-button visuals to close-button.css with size and
static-color token overrides, interactive states, pseudo-element focus ring,
and forced-colors support. Document exposed --swc-close-button-* properties
and add an Anatomy story for Phase 5 verification.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(close-button): add Storybook docs and consumer migration guide

Flesh out close-button.mdx with anatomy, options, states, and accessibility
sections. Add migration-guide.mdx for sp-close-button upgrades and align
stories with Phase 7 docs conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(close-button): drop unused static modifier classes and align plan

Static-color styling is driven by :host([static-color]) in CSS. Update the
migration plan TL;DR, sequencing, and Q1 to reflect ButtonBase-only
architecture and CSS-only icon scale.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(close-button): align focus and press treatment with button patterns

Adopt border/outline focus ring, press perspective transform, and remove
custom forced-colors overrides per review. Drop redundant default variant
from the static colors story and update docs/tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…ge (#6405)

Complete Phase 6 testing with ARIA snapshots for key stories and tab-focus
checks for delegatesFocus and disabled skip behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-add the mixin composition @todo that was dropped when static-color
documentation was added during close-button migration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Close buttons are icon-only dismiss controls with no visible label.
Enforce accessible-label as the sole naming channel and update stories,
tests, and docs per review feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove redundant properties text, simplify size descriptions,
and drop static-colors implementation detail.

Co-authored-by: Cursor <cursoragent@cursor.com>
Revert close-button-driven changes from ButtonBase/Button and keep
static-color behavior on CloseButton so this migration is scoped and
independent from shared action-button/base coordination.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TarunAdobe TarunAdobe requested review from 5t3ph and Rajdeepc June 26, 2026 06:56
@TarunAdobe TarunAdobe force-pushed the ttomar/close-button-migration branch from 308eb53 to d3a314d Compare June 26, 2026 06:57
Replace deprecated close-button token references with current token names
so SWC build and targeted component tests pass.

Co-authored-by: Cursor <cursoragent@cursor.com>

@5t3ph 5t3ph 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.

Noticed this was a nuanced case where the intended icon token matches were supposed to be to workflow icon sizes.

}

:host([size="s"]) {
--swc-close-button-icon-size: token("ui-icon-large");

@5t3ph 5t3ph Jun 26, 2026

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.

Suggested change
--swc-close-button-icon-size: token("ui-icon-large");
--swc-close-button-icon-size: token("ui-icon-small");

}

:host([size="l"]) {
--swc-close-button-icon-size: token("ui-icon-2x-large");

@5t3ph 5t3ph Jun 26, 2026

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.

Suggested change
--swc-close-button-icon-size: token("ui-icon-2x-large");
--swc-close-button-icon-size: token("ui-icon-large");

}

:host([size="xl"]) {
--swc-close-button-icon-size: token("ui-icon-2x-large");

@5t3ph 5t3ph Jun 26, 2026

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.

Suggested change
--swc-close-button-icon-size: token("ui-icon-2x-large");
--swc-close-button-icon-size: token("ui-icon-extra-large");

Comment on lines +78 to +79
inline-size: var(--swc-close-button-icon-size, token("ui-icon-extra-large"));
block-size: var(--swc-close-button-icon-size, token("ui-icon-extra-large"));

@5t3ph 5t3ph Jun 26, 2026

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.

Not a typo, the default Medium and also Large are both spec'd to be the same large size.

Suggested change
inline-size: var(--swc-close-button-icon-size, token("ui-icon-extra-large"));
block-size: var(--swc-close-button-icon-size, token("ui-icon-extra-large"));
inline-size: var(--swc-close-button-icon-size, token("ui-icon-large"));
block-size: var(--swc-close-button-icon-size, token("ui-icon-large"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_vrt Triggers the Chromatic VRT run for 2nd-gen Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants