-
Notifications
You must be signed in to change notification settings - Fork 371
feat(Progress): add hideStatusIcon flag #12038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(Progress): add hideStatusIcon flag #12038
Conversation
Preview: https://pf-react-pr-12038.surge.sh A11y report: https://pf-react-pr-12038-a11y.surge.sh |
Signed-off-by: gitdallas <[email protected]>
e86cf84
to
6c5dcc6
Compare
)} | ||
{StatusIcon && ( | ||
<span className={css(progressStyle.progressStatusIcon)}> | ||
<span className={css(progressStyle.progressStatusIcon)} data-testid="progress-status-icon"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to hard code this test id into the component? I'm not sure what a better way to do it would be, but I don't love this, and the fact that there isn't a better way is probably signaling a lack of a11y on this. Would love @thatblindgeye's thoughts on this.
Signed-off-by: gitdallas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a demo? Probably want to add a prop comment. Otherwise looks fine to me!
Signed-off-by: gitdallas <[email protected]>
Co-authored-by: Rebecca Alpert <[email protected]>
@rebeccaalpert i replaced a few examples with an interactive one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Surge doesn't have it for whatever Surge-y reason, but localhost looks great.
* We recommend the helper text component as it was designed for this purpose. | ||
*/ | ||
helperText?: React.ReactNode; | ||
/** Hide the status icon, helpful when space is limited (such as within table cells) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a slight tweak to this:
/** Hide the status icon, helpful when space is limited (such as within table cells) */ | |
/** Flag indicating whether the status icon should be hidden, helpful when space is limited (such as within table cells). When set to true, you must ensure the context of the status is provided in another way, such as via the progress measure. */ |
Or something along those lines. Basically, I think we should recommend that a consumer NOT have an implementation where they:
- want to use status,
- have
measureLocation="none"
, - and hide the status icon
At that point they end up with a progress that visually may indicate the status via the bar color, but without the icon it falls into the "don't use color alone to convey status" issue. The measure percentage/value in lieu of an icon might be an okay alternative.
Or maybe instead of updating this description we update the logic so that hideStatusIcon only applies when measureLocation is anything other than "none", prevent that from even happening.
Closes #11983