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: Update Table to 2.10.0 implementation #1110

Merged
merged 31 commits into from
Apr 27, 2021

Conversation

SirenaBorracha
Copy link
Contributor

@SirenaBorracha SirenaBorracha commented Apr 11, 2021

Summary

This PR updates the USWDS Table component with scrollable, striped, compact, stacked, and stacked-header variations as added in the USWDS 2.10.0 release.

Related Issues or PRs

closes #991

  • Is there a better way than putting stackedStyle = 'none' in the function signature to assign a default value?

This PR does not add the Sortable Table rows variant as that is future work to cover updates made by the USWDS 2.11.0 release.

Reviewers may notice some styling differences between our Storybook versus the USWDS examples, particularly with regards to fonts/text sizing. As Hana has noted further down in this PR, we suspect this is due to the difference in how USWDS applies their CSS to how we apply it, and is less relevant to this work as we are simply rendering those applied styles on children, not the Table component itself.

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

Scrollable Table

scrollable-table

Striped Table

Screen Shot 2021-04-15 at 3 10 05 PM

Compact Table

Screen Shot 2021-04-15 at 3 10 54 PM

Logged warning if the user attempts to apply both compact and stackedStyle

From the USWDS notes re: compact styling: "Pairs well with scrollable and striped variants, but is not suitable for use with stacked variants."

Screen Shot 2021-04-13 at 2 52 12 PM

Stacked Table With Custom Controls bordered and stackedStyle

stackedStyles

…; add tests for applied classNames striped and compact, check for enclosing div for scrollable
…e, add logic to exclude compact className on stacked styles
@SirenaBorracha SirenaBorracha marked this pull request as draft April 11, 2021 20:08
@SirenaBorracha SirenaBorracha changed the title [WIPupdate table to 2.10 implementation 991 [WIP] feat: Update Table to 2.10.0 implementation Apr 11, 2021
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 11, 2021 20:11 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 11, 2021 20:58 Inactive
…of getByRole for renders without errors, remove superfluous data-testid
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 11, 2021 21:14 Inactive
@SirenaBorracha SirenaBorracha changed the title [WIP] feat: Update Table to 2.10.0 implementation feat: Update Table to 2.10.0 implementation Apr 11, 2021
@SirenaBorracha SirenaBorracha marked this pull request as ready for review April 11, 2021 21:15
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 12, 2021 18:12 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 19, 2021 20:56 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 20, 2021 19:42 Inactive
Copy link
Contributor

@brandonlenz brandonlenz left a comment

Choose a reason for hiding this comment

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

One tiny thing and I'm good to approve. Glad you and @haworku were able to get some clarity into that cell styling. I'm good with not worrying about it too much as well.

package.json Outdated Show resolved Hide resolved
src/components/Table/Table.stories.tsx Show resolved Hide resolved
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 23, 2021 00:12 Inactive
yarn.lock Outdated Show resolved Hide resolved
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 22:01 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 22:38 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 23:12 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 26, 2021 23:52 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 27, 2021 01:14 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook April 27, 2021 15:43 Inactive
@SirenaBorracha SirenaBorracha merged commit 117a6c7 into main Apr 27, 2021
@SirenaBorracha SirenaBorracha deleted the ak-update-table-to-2.10-implementation-991 branch April 27, 2021 18:35
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 added a commit that referenced this pull request May 12, 2021
* Add logic and Storybook examples for scrollable, compact, and striped; add tests for applied classNames striped and compact, check for enclosing div for scrollable

* Add logic, Storybook examples, and tests for stacked styles; remove comments from code

* Remove superfluous boolean variable

* Add div to stacked styles in Storybook to apply width-mobile className, add logic to exclude compact className on stacked styles

* Remove is false default assignments from passed in args to Table

* Combine stackedStyles storybook examples by adding Storybook controls for bordered/borderless and headers/no headers options

* Add test for borderless stacked table, remove queryByTestId in favor of getByRole for renders without errors, remove superfluous data-testid

* Merge branch 'main' into ak-update-table-to-2.10-implementation-991

* Factor out repeated table code

* Respond to PR feedback, update data-testid to more accurately reflect what the div represents, remove any assignments true, update scrollable Storybook example to use the same example data as USWDS

* Update scrollable storybook example to have a border

* Fix scrollable Storybook example data formatting

* Continue to fix scrollable Storybook example data formatting

* Add footnote p tag in scrollable storybook example, pass argTypes into striped storybook example to enable the storybook control for bordered

* Add console warning for compact and stackStyle combination, add argType for striped and add to Storybook controls

* Use Storybook viewport addon to default to mobile to show stacked styles rather than an enclosing div with width-mobile classname

* Remove incorrect className from scrollableTestContent subheadings

* Remove whitespace from package.json

* Resolve conflicts in yarn.lock

* Resolve conflicts in yarn.lock

* Regenerate yarn.lock

* Deleting yarn.lock

* Regenerate yarn.lock

Co-authored-by: Brandon Lenz <brandonalenz@gmail.com>
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.

[feat] Update Table to USDWS 2.10.0 implementation
4 participants