Skip to content

chore(DataList): provided context for demo icons - #7750

Merged
thatblindgeye merged 2 commits into
patternfly:mainfrom
thatblindgeye:iss7275_datalistIconContext
Aug 28, 2025
Merged

thatblindgeye merged 2 commits into
patternfly:mainfrom
thatblindgeye:iss7275_datalistIconContext

Conversation

@thatblindgeye

Copy link
Copy Markdown
Contributor

Closes #7275

  • Added SR text
  • Updated "x" icon to error/danger icon
  • Added status color to the applicable icons

@thatblindgeye
thatblindgeye requested review from a team, lboehling, mcoker and nicolethoen and removed request for a team August 20, 2025 14:12
@patternfly-build

patternfly-build commented Aug 20, 2025 •

Copy link
Copy Markdown
Collaborator

{{> data-list--icon-text data-list--icon-text--icon="times-circle" data-list--icon-text--text="1"}}
{{> data-list--icon-text data-list--icon-text--icon="code" data-list--icon-text--text="9" data-list--icon-text--screenreader-text="Code blocks"}}
{{> data-list--icon-text data-list--icon-text--icon="cube" data-list--icon-text--text="2" data-list--icon-text--screenreader-text="Workspaces"}}
{{> data-list--icon-text data-list--icon-text--icon="check-circle" data-list--icon-text--modifier="pf-m-success" data-list--icon-text--text="11" data-list--icon-text--screenreader-text="Completed"}}

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 you have here is great and probably preferred, but just FYI in cases like this where the data-list--icon-text is so limited in scope (it should only have a single icon in it), it's totally fine to just use icon-content--modifier directly on data-list--icon-text.

Suggested change
{{> data-list--icon-text data-list--icon-text--icon="check-circle" data-list--icon-text--modifier="pf-m-success" data-list--icon-text--text="11" data-list--icon-text--screenreader-text="Completed"}}
{{> data-list--icon-text data-list--icon-text--icon="check-circle" icon-content--modifier="pf-m-success" data-list--icon-text--text="11" data-list--icon-text--screenreader-text="Completed"}}

Also seeing this makes me think we should really enhance the icon component hbs to have parameters/props for icon--IsWarning, icon--IsSmall, etc

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.

Ah wasnt sure if that would pass through so just went with the new attr, updated to just use icon-content--modifier!

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.

Yep! Parameters are inherited to all nested things unless they're explicitly set/defined anywhere in the children. FWIW sometimes we add a little context wrapper like this - id-wrapper.hbs doesn't exist, so it renders nothing, but it does set a bunch of parameters/props as context for its children

{{#> id-wrapper menu-toggle--check--id=menu-toggle--id check-input--IsChecked=(ternary check--IsChecked true check-input--IsChecked)}}
{{#if menu-toggle--check--IsStandalone}}
{{#> check check--type="label" check--modifier="pf-m-standalone" check--IsDisabled=menu-toggle--IsDisabled}}
{{> check-input check-input--attribute=(concat 'id="' menu-toggle--check--id '-input" name="' menu-toggle--check--id '-input" aria-label="Select all items"')}}
{{/check}}
{{else}}
{{#> check check--type="label" check--attribute=(concat 'for="' menu-toggle--check--id '-input"') check--IsDisabled=menu-toggle--IsDisabled}}
{{> check-input check-input--attribute=(concat 'id="' menu-toggle--check--id '-input" name="' menu-toggle--check--id '-input"')}}
{{#if menu-toggle--check--text}}
{{#> check-label check--IsLabelWrapped=true check-label--IsDisabled=menu-toggle--IsDisabled}}
{{menu-toggle--check--text}}
{{/check-label}}
{{/if}}
{{/check}}
{{/if}}
{{/id-wrapper}}

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

BEEYOUTIFUL

@lboehling lboehling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice!

@thatblindgeye
thatblindgeye merged commit cf7aa64 into patternfly:main Aug 28, 2025
4 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.3.0-prerelease.53 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataList - demos need additional context for icons with number text

5 participants