-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: New Component ProcessList MVP #1107
Conversation
…List and ProcessListItem components, rendering some text in a div in Storybook
…ility to pass in attributes
@haworku and @brandonlenz, @suzubara requested that I get your opinions on whether or not we care to provide a Do either of you feel strongly in favor of adding the header subcomponent? |
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.
@haworku and @brandonlenz, @suzubara requested that I get your opinions on whether or not we care to provide a
ProcessListItemHeader
subcomponent. As is,ProcessList
is flexible but does not provide all of the tools that our users might benefit from.Do either of you feel strongly in favor of adding the header subcomponent?
Personally, I'm for creating the subcomponent. Since it should be able to be any type of heading (or p
) tag, we could expose a variant prop or similar to allow the implementer to select what type of markup should be used.
}: ProcessListProps & JSX.IntrinsicElements['ol']): React.ReactElement => { | ||
const classes = classnames('usa-process-list', className) | ||
return ( | ||
<> |
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.
I don't think this Fragment is needed
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.
One small thing I noticed. This looks really good!
I added a separate comment about the header.
Maybe a generic type prop so the interface might looks something like: <ProcessListHeading<'h1'>>"Heading text"</ProcessListHeading>. Disclaimer
|
Created issue #1134 for the |
…orks/react-uswds into ak-new-component-process-list-979
yarn.lock
Outdated
uswds@2.10.3: | ||
version "2.10.3" | ||
resolved "https://registry.yarnpkg.com/uswds/-/uswds-2.10.3.tgz#16d34cee81897762d6d69d3ac83aa55129826fa6" | ||
integrity sha512-krNRzx1jRzOJpuH/qtmQhd5zxnXTaDVqrPNYT99sJbxzWUqjb1zZHh3jFNo+xKDpNuiO0XMPwZwlaSp2YdZ3Ag== | ||
|
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.
this file shouldn't have any changes
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.
Awesome job!
## [1.17.0](1.16.0...1.17.0) (2021-05-05) ### Features * Checkbox Tile Variant ([#1104](#1104)) ([9936c4a](9936c4a)) * Implement ProcessListHeading subcomponent ([#1162](#1162)) ([964e34c](964e34c)) * New Component ProcessList MVP ([#1107](#1107)) ([1bc0f93](1bc0f93)) * New Component SiteAlert ([#1099](#1099)) ([c1e88e0](c1e88e0)) * New Component SummaryBox ([#1098](#1098)) ([b2279b4](b2279b4)) * Radio Button Tile Variant ([#1101](#1101)) ([a2f40a0](a2f40a0)) * Update Grid components to render any type of element ([#1166](#1166)) ([07468c8](07468c8)), closes [#1194](#1194) * Update Search component to support i18n ([#1192](#1192)) ([5241d15](5241d15)) * Update Table to 2.10.0 implementation ([#1110](#1110)) ([117a6c7](117a6c7))
## [1.17.0](1.16.0...1.17.0) (2021-05-05) ### Features * Checkbox Tile Variant ([#1104](#1104)) ([9936c4a](9936c4a)) * Implement ProcessListHeading subcomponent ([#1162](#1162)) ([964e34c](964e34c)) * New Component ProcessList MVP ([#1107](#1107)) ([1bc0f93](1bc0f93)) * New Component SiteAlert ([#1099](#1099)) ([c1e88e0](c1e88e0)) * New Component SummaryBox ([#1098](#1098)) ([b2279b4](b2279b4)) * Radio Button Tile Variant ([#1101](#1101)) ([a2f40a0](a2f40a0)) * Update Grid components to render any type of element ([#1166](#1166)) ([07468c8](07468c8)), closes [#1194](#1194) * Update Search component to support i18n ([#1192](#1192)) ([5241d15](5241d15)) * Update Table to 2.10.0 implementation ([#1110](#1110)) ([117a6c7](117a6c7))
Summary
This PR adds the USWDS ProcessList component in an MVP state.
Related Issues or PRs
#979
An enhancement that we may want to add as part of this GitHub issue would be to create a
ProcessListItemHeader
subcomponent. This would allow us to offer an out of the box way for our users to pass a heading that would automatically be styled by theusa-process-list__heading
class irrespective of what element type the user passed.This enhancement would meet the USWDS Accessibility guideline, "Use semantic heading levels," that states, "Though our default code uses an
<h4>
, use the correct heading level with the class nameusa-process-list__heading
in your own implementation."How To Test
Check out this branch and run yarn test to execute tests and yarn storybook to see the new component in action.
Alternatively, you can scroll to the bottom of this page and click "Show environments" on the right above the comment input box to access this component in Storybook.
Screenshots (optional)
Default
No text, custom sizing
Custom Sizing