Skip to content

feat(spinner): port pf-v5-spinner to pf-v6-spinner element#3137

Open
zeroedin wants to merge 11 commits into
staging/pfv6from
feat/v6-spinner
Open

feat(spinner): port pf-v5-spinner to pf-v6-spinner element#3137
zeroedin wants to merge 11 commits into
staging/pfv6from
feat/v6-spinner

Conversation

@zeroedin
Copy link
Copy Markdown
Collaborator

@zeroedin zeroedin commented May 8, 2026

Summary

  • Removes <pf-v5-spinner>
  • Ports <pf-v5-spinner> to <pf-v6-spinner> web component for PatternFly v6
  • SVG-based animated spinner with role="progressbar" via ElementInternals
  • Supports size (xs/sm/md/lg/xl), inline, diameter, and accessible-label attributes
  • CSS animation with prefers-reduced-motion support
  • Demos: basic, size-variations, custom-size, inline-size

Closes #3037
Depends on #3130

Intentional divergences from React

  • xs size supported (exists in PF core SCSS but not React's enum)
  • size defaults to undefined (CSS fallback achieves xl visual default without sprouting attribute)
  • accessible-label abstracts ariaLabel/ariaValueText per ADVICE.md
  • Uses modern CSS rotate property instead of transform: rotate()
  • prefers-reduced-motion handled via media query (React uses .pf-m-no-motion class)

Test plan

  • npm run test passes
  • Demos render correctly at localhost:8000 with ?rendering=chromeless
  • All size variants visually match patternfly.org
  • Screen reader announces progressbar role with correct label
  • Animation stops with prefers-reduced-motion: reduce

Assisted-By: Claude noreply@anthropic.com

zeroedin added 4 commits May 8, 2026 14:08
Port pf-v5-spinner to pf-v6-spinner with v6 design tokens and API:

- Migrate CSS tokens from --pf-v5-* to --pf-v6-* namespace
- Update icon size tokens to --pf-t--global--icon--size--* (v6)
- Add `xs` size variant (new in v6)
- Add `inline` boolean attribute for font-size-inherited spinners
- Add `accessible-label` attribute (abstracts aria-label via internals)
- Set role=progressbar and aria-valuetext via InternalsController
- Export `SpinnerSize` type union
- Avoid sprouting default `size` attribute (CSS handles xl default)
- Add demos: basic, size-variations, custom-size, inline-size
- Add unit tests with a11ySnapshot assertions and size measurements
- Update elements/package.json exports

Closes #3037

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused styleMap import
- Use `static styles = [styles]` array form convention
- Move diameter CSS custom property to willUpdate (host style)
- Sync ariaValueText with accessibleLabel changes
- Simplify render return type to TemplateResult
- Use individual rotate property instead of transform function
- Add prefers-reduced-motion media query
- Add cem generate output path to config

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 896df94

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

This PR includes changesets to release 1 package
Name Type
@patternfly/elements Major

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "feat(spinner): port pf-v5-spinner to pf-v6-spinner element"
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit a0170b5
😎 Deploy Preview https://deploy-preview-3137--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions Bot added the AT passed Automated testing has passed label May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

SSR Test Run for c10f28a: Report

Copy link
Copy Markdown
Member

@bennypowers bennypowers left a comment

Choose a reason for hiding this comment

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

The issue in question is an "update" issue, not a "create" issue:

  • commit message must be feat(spinner)!: port to pf-v6-spinner
  • delete elements/pf-v5-spinner

Comment thread .config/cem.yaml Outdated
Comment thread elements/package.json Outdated
if (changed.has('accessibleLabel')) {
const label = this.accessibleLabel ?? 'Loading...';
this.#internals.ariaLabel = label;
this.#internals.ariaValueText = label;
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.

this should be a separate public property

cc @adamjohnson

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 17904ce: Report

Copy link
Copy Markdown
Member

@bennypowers bennypowers left a comment

Choose a reason for hiding this comment

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

should remove all existing pf-v5-spinner references

Comment thread elements/pf-v6-spinner/pf-v6-spinner.ts Outdated
Comment thread elements/pf-v6-spinner/README.md Outdated
<pf-v6-spinner style="--pf-v6-c-spinner--diameter: 80px">Loading...</pf-v6-spinner>
```

## Discrepancies from React
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@bennypowers thoughts?

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for f337d87: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 3e4bc71: Report

@zeroedin zeroedin changed the title feat(spinner): add pf-v6-spinner element feat(spinner): port pf-v5-spinner to pf-v6-spinner element May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for fa09f3d: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 7e55065: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for a0170b5: Report

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

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants