Skip to content
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 SummaryBox #1098

Merged
merged 32 commits into from
Apr 30, 2021
Merged

Conversation

SirenaBorracha
Copy link
Contributor

@SirenaBorracha SirenaBorracha commented Apr 6, 2021

Summary

This PR adds the USWDS SummaryBox component.

Related Issues or PRs

closes #988

I took a different approach than the story outlined, as suggested by Hana, that prioritizes flexibility for the user over providing more structure.

If in the future we wish to constrain the component further, we could extend this component using the proposed implementation from the issue. To do so, we would add the <ul> into SummaryBox, and create two subcomponents that would provide the rest of the skeleton for the list items and links; SummaryBoxInfoItem with a <li> root element, and SummaryBoxLink which could be implemented using the existing <Link asCustom /> component, following the pattern in BreadcrumbLink and IdentifierLink.

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.

Screenshots

Screen Shot 2021-04-05 at 6 17 28 PM

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 00:58 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 01:06 Inactive
…n each anchor tag, disable eslint anchor validity check in both files
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 01:25 Inactive
… props to its own obj and pass into the test
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 01:30 Inactive
…book example, add test checking for rendering children
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 02:20 Inactive
@SirenaBorracha SirenaBorracha changed the title [WIP] feat: MVP New Component SummaryBox feat: MVP New Component SummaryBox Apr 6, 2021
@SirenaBorracha SirenaBorracha marked this pull request as ready for review April 6, 2021 02:22
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 02:26 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 6, 2021 03:56 Inactive
@SirenaBorracha SirenaBorracha changed the title feat: MVP New Component SummaryBox feat: New Component SummaryBox Apr 6, 2021
@brandonlenz brandonlenz removed the status: hold merge This indicates not to merge the PR as there is a development dependency/other reason to hold off. label Apr 20, 2021
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 20, 2021 19:41 Inactive
package.json Outdated Show resolved Hide resolved
import { SummaryBox } from './SummaryBox'

export default {
title: 'Components/SummaryBox',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can we name this Components / Summary box so it matches the USWDS name?

yarn.lock Outdated
>>>>>>> main
=======

>>>>>>> fc36dbd77f8c8665eb25297a28c56e1fd6b4a7ff
Copy link
Contributor

Choose a reason for hiding this comment

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

These merge conflicts need to be resolved

}

const summaryBoxContent = (
<div className="usa-summary-box__text">
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this <div className="usa-summary-box__text"> is repeated in the Story (since it's also rendered in the component itself) - can we remove?

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 21:55 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 23:47 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 27, 2021 18:57 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 28, 2021 17:27 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 28, 2021 17:33 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 30, 2021 20:35 Inactive
@SirenaBorracha SirenaBorracha merged commit b2279b4 into main Apr 30, 2021
@SirenaBorracha SirenaBorracha deleted the ak-new-component-summary-box-988 branch April 30, 2021 20:44
SirenaBorracha added a commit that referenced this pull request May 5, 2021
## [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))
brandonlenz pushed a commit that referenced this pull request May 12, 2021
* Create skeleton for new component SummaryBox, render passed in heading, render passed in text as children

* Add default Storybook example

* Add test for ability to pass props

* Remove empty comment

* Make Storybook example variable name lower case

* Commit yarn.lock changes

* Remove unwanted spaces from Storybook example

* Remove everything except '#' from the test and Storybook href props in each anchor tag, disable eslint anchor validity check in both files

* Remove hardcoded role prop from SummaryBox root div, move test custom props to its own obj and pass into the test

* Remove unnecessary data-testid, separate summary box content in storybook example, add test checking for rendering children

* Export SummaryBox from index.ts

* Remove straggler - extended href name

* Move enclosing div from Storybook to SummaryBox component wrapping children, make the props passed to the root div more explicitly named divProps

* Add check for passing custom classname

* Update stories file as per Suz's PR feedback

* Resolve conflicts in yarn.lock

* Regenerate yarn.lock

* Remove unnecessary spaces from default export in Storybook
brandonlenz pushed a commit that referenced this pull request May 12, 2021
## [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Component: Summary box
5 participants