Skip to content

feat(banner): add pf-v6-banner#3143

Open
zeroedin wants to merge 1 commit into
staging/pfv6from
feat/pf-v6-banner
Open

feat(banner): add pf-v6-banner#3143
zeroedin wants to merge 1 commit into
staging/pfv6from
feat/pf-v6-banner

Conversation

@zeroedin
Copy link
Copy Markdown
Collaborator

Summary

Closes #2983

  • Adds pf-v6-banner element ported from pf-v5-banner and aligned with the React v6 Banner 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

⚠️ No Changeset found

Latest commit: b6b32af

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

@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): add pf-v6-banner"
}

@github-actions
Copy link
Copy Markdown
Contributor

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 4a848b0
😎 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?

Comment on lines +70 to +75
return html`
<div id="container" class=${classMap({
[this.color ?? '']: !!this.color,
[this.status ?? '']: !!this.status,
})}>
${!this.screenReaderText ? nothing
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.

Suggested change
return html`
<div id="container" class=${classMap({
[this.color ?? '']: !!this.color,
[this.status ?? '']: !!this.status,
})}>
${!this.screenReaderText ? nothing
const { color = '', status = '' } = this;
return html`
<div id="container" class="${classMap({ [color]: !!color, [status]: !!status })}">
${!this.screenReaderText ? nothing

minor formatting nit

Comment on lines +75 to +78
${!this.screenReaderText ? nothing
: html`<span class="sr-only">${this.screenReaderText}</span>`}
<slot></slot>
</div>
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.

Suggested change
${!this.screenReaderText ? nothing
: html`<span class="sr-only">${this.screenReaderText}</span>`}
<slot></slot>
</div>
<span class="sr-only" ?hidden="${!this.screenReaderText}">${this.screenReaderText}</span>
<slot></slot>
</div>

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