Skip to content

feat(helper-text)!: port to <pf-v6-helper-text> - #3155

Open
adamjohnson wants to merge 13 commits into
staging/pfv6from
feat/v6-helper-text
Open

adamjohnson wants to merge 13 commits into
staging/pfv6from
feat/v6-helper-text

Conversation

@adamjohnson

@adamjohnson adamjohnson commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Removes <pf-v5-helper-text>
  • Ports <pf-v5-helper-text> to <pf-v6-helper-text> web component for PatternFly v6
  • Displays contextual feedback or validation messages for form fields
  • Supports variant (default/indeterminate/warning/success/error), has-icon, dynamic, and screen-reader-text attributes
  • Built-in SVG icons from @patternfly/react-icons (rh-ui-minus, rh-ui-warning-fill, rh-ui-check-circle-fill, rh-ui-error-fill)
  • Dark mode support via light-dark() CSS fallbacks
  • Demos: basic (index), with-custom-icons, multiple, dynamic

Closes #3012

Intentional divergences from React

  • Single element instead of React's HelperText (container) + HelperTextItem (item) pair; use plain HTML wrappers with aria-live for grouping
  • has-icon attribute for opt-in icon display (React auto-shows icons for non-default variants)
  • icon slot replaces React's icon prop (ReactNode → slotted markup)
  • screen-reader-text attribute maps to React's screenReaderText prop
  • dynamic attribute exposes React's internal .pf-m-dynamic CSS modifier class
  • Container props (component, isLiveRegion, aria-label) not implemented; users apply these directly on wrapper elements
  • No dependency on <pf-v5-icon> — uses inline SVG icons

Test plan

  • npm run test passes
  • Demos render correctly at localhost:8000
  • All variant styles (colors, font weight, icons) visually match patternfly.org
  • Dark mode colors correct when switching color scheme
  • Screen reader text announces variant status for non-default variants
  • Custom screen-reader-text overrides default announcement
  • Empty screen-reader-text="" suppresses announcement
  • Custom icon slot displays slotted SVG in place of default icon
  • Dynamic demo shows aria-live container with mixed success/error items

Assisted-By: Claude

@changeset-bot

changeset-bot Bot commented May 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 75b7590

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

@adamjohnson adamjohnson changed the title Feat/v6 helper text feat(helper-text): port <pf-v5-helper-text> to <pf-v6-helper-text> element May 20, 2026
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "feat(helper-text)!: port to `<pf-v6-helper-text>`"
}

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 0ff2363
😎 Deploy Preview https://deploy-preview-3155--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 20, 2026
@adamjohnson adamjohnson moved this from Needs triage to PR Review in PatternFly Issues May 20, 2026
@github-actions

This comment has been minimized.

@adamjohnson adamjohnson linked an issue May 20, 2026 that may be closed by this pull request
18 tasks
@adamjohnson
adamjohnson marked this pull request as ready for review May 20, 2026 18:03
@adamjohnson adamjohnson removed the AT passed Automated testing has passed label May 20, 2026
@github-actions github-actions Bot added the AT passed Automated testing has passed label May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

SSR Test Run for 7f5d1f9: Report

Comment thread elements/pf-v6-helper-text/demo/dynamic.html Outdated
Comment thread elements/pf-v6-helper-text/demo/with-custom-icons.html Outdated
Comment thread elements/pf-v6-helper-text/README.md Outdated
Comment thread elements/pf-v6-helper-text/pf-v6-helper-text.ts Outdated
@adamjohnson
adamjohnson requested a review from bennypowers June 1, 2026 21:35
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

SSR Test Run for 7646863: Report

Comment thread elements/pf-v6-helper-text/README.md Outdated

| React prop | Notes |
| --- | --- |
| `HelperText` `component` (`'div'` \| `'ul'`) | Use a standard HTML `<div>` or `<ul>` wrapper instead. |

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
| `HelperText` `component` (`'div'` \| `'ul'`) | Use a standard HTML `<div>` or `<ul>` wrapper instead. |
| `HelperText` `component` (`'div'` \| `'ul'`) | Use a standard HTML `<ul>` wrapper if necessary. |

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.

on second thought, let's just tell people to use a ul with some css.

rename multiple.html to multiple-items.html and have it use <ul><li> and some pf tokens for the spacing.

@bennypowers bennypowers Jun 15, 2026

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.

<pf-v6-progress>
  <ul slot="helper-text">
    <li><pf-v6-helper-text>some text

how would that work if we implement #3152 (comment) (adding all elements in helper-text to ariaDescribedByElements on progress host). i.e. is ul allowed as a describedby element?

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.

@hellogreg NB: we'll need to test that this actually works with various SR vendors. We'll ping here when it's ready for testing

Comment thread elements/pf-v6-helper-text/README.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

SSR Test Run for 19cb63e: Report

- Rename multiple.html to multiple-items.html, use `<ul><li>` with PF
  spacing tokens instead of role="list" div
- Update README: `component` and `isLiveRegion` wording per review
  suggestions, usage example uses `<ul>` pattern
- Fix changeset: remove stale `has-icon`/`screen-reader-text` references,
  remove emojis, separate breaking changes from features
- Delete v5 build artifacts

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

SSR Test Run for 0ff2363: Report

@zeroedin zeroedin changed the title feat(helper-text): port <pf-v5-helper-text> to <pf-v6-helper-text> element feat(helper-text)!: port to <pf-v6-helper-text> Aug 20, 2026

This branch has not been deployed

No deployments
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

Status: PR Review

Development

Successfully merging this pull request may close these issues.

[feat]: Update <pf-v6-helper-text> for PatternFly v6

2 participants