Skip to content

feat(banner): port pf-v5-banner to pf-v6-banner#3143

Open
zeroedin wants to merge 6 commits into
staging/pfv6from
feat/pf-v6-banner
Open

feat(banner): port pf-v5-banner to pf-v6-banner#3143
zeroedin wants to merge 6 commits into
staging/pfv6from
feat/pf-v6-banner

Conversation

@zeroedin
Copy link
Copy Markdown
Collaborator

@zeroedin zeroedin commented May 12, 2026

Summary

Closes #2983

  • Removes pf-v5-banner
  • Ports pf-v5-banner to pf-v6-banner and aligned with the React v6 component
  • Replaces v5 variant attribute with separate color (8 decorative colors) and status (5 semantic statuses) attributes, matching React's split API
  • Adds screen-reader-text attribute for visually-hidden status announcements (WCAG 1.3.1)
  • Retains sticky attribute (maps to React isSticky)
  • Removes v5 icon attribute/slot — icons are now composed in the default slot, matching React v6
  • All CSS uses v6 design tokens with hex fallbacks via light-dark() for standalone usage

Deviations from React

  • Status demo uses pf-v5-icon: The status demo composes icons in the default slot using pf-v5-icon because pf-v6-icon is not yet merged to staging/pfv6. Once pf-v6-icon lands, the status demo should be updated to use pf-v6-icon with the rh-ui-*-fill icon set to match the React demos visually.
  • Sticky demo: React has isSticky as a prop but no dedicated demo on patternfly.org. We include a standalone sticky demo since the behavior requires scrollable content to verify — this was carried forward from the v5 element.

Test plan

  • 36 unit tests passing (instantiation, upgrade, all 8 colors, all 5 statuses, sticky positioning, slotted link a11y, screen-reader-text presence/absence)
  • Visual comparison against patternfly.org in both light and dark mode
  • /review-a11y — no critical issues
  • /review-api — no critical issues
  • /review-demos — all demos match patternfly.org parity
  • cem health — 87/100 (above 80% threshold)
  • Verify demos at http://localhost:8000/elements/banner/demo/{slug}?rendering=chromeless

🤖 Generated with Claude Code

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: d441d78

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 12, 2026

✅ Commitlint tests passed!

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit ce8094a
😎 Deploy Preview https://deploy-preview-3143--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 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 4a848b0: Report

@property({ type: Boolean, reflect: true }) sticky = false;

/** Text announced by screen readers to indicate the type of banner. */
@property({ attribute: 'screen-reader-text' }) screenReaderText?: string;
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 attribute name is vague: it's not immediately clear which text this is. only after reading the jsdoc does the user discover that this text describes the "type" of banner. "type", mind you, is not an attribute on this element, so that term is also vague. moreover, we use accessible-label as the name for screen reader texts in other elements.

@adamjohnson wdyt?

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.

It's directly from React, screenReaderText is the prop name in Banner.tsx. The agent mapped it to screen-reader-text as the HTML attribute (dash-case convention).

I definitely think this is where we can make a judgment call, but we have to ensure we are consistent across the board here.

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.

in this case, let's lean to "authentic to the end user react experience" more, and "authentic to the pfe developer experience" more

Comment thread elements/pf-v6-banner/pf-v6-banner.ts Outdated
Comment thread elements/pf-v6-banner/pf-v6-banner.ts Outdated
@bennypowers
Copy link
Copy Markdown
Member

this should delete pf-v5-banner and update all references

@zeroedin
Copy link
Copy Markdown
Collaborator Author

this should delete pf-v5-banner and update all references

Ok, good, that answers a question I had about the exports previously. We could update the /update-element skill to do this upon completion, unless you find value in keeping the folder around for any reason post-agent update?

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for e2d426f: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 561aaec: Report

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

SSR Test Run for 4d23357: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 31f2e4d: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for ce8094a: Report

@zeroedin
Copy link
Copy Markdown
Collaborator Author

Need to update README.md to include divergences still.

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