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: Add DateRangePicker Component #983

Merged
merged 28 commits into from
Mar 17, 2021
Merged

Conversation

brandonlenz
Copy link
Contributor

@brandonlenz brandonlenz commented Mar 1, 2021

Summary

Adds Date Range Picker component

Related Issues or PRs

closes #339

How To Test

Thanks to the CI artifacts, you should be able to simply click "show environments" to access storybook and mess with this new component

Screenshots (optional)

image

@brandonlenz brandonlenz added this to the USWDS 2.8.0 milestone Mar 1, 2021
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 1, 2021 21:56 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 00:14 Inactive
@brandonlenz brandonlenz changed the title DateRangePicker initial commit Feat: Add DateRangePicker Component Mar 2, 2021
@brandonlenz brandonlenz changed the title Feat: Add DateRangePicker Component feat: Add DateRangePicker Component Mar 2, 2021
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 17:23 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 20:42 Inactive
- Start date should have a max date of either the specified max start date OR the end date (if selected)

- End date should have a min date of either the specified min date OR the start date (if selected)
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 22:51 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 23:02 Inactive
@brandonlenz brandonlenz marked this pull request as ready for review March 2, 2021 23:07
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 2, 2021 23:12 Inactive
@brandonlenz brandonlenz removed this from the USWDS 2.8.0 milestone Mar 12, 2021
brandonlenz and others added 2 commits March 12, 2021 15:45
- Fix prop type collision with 'onChange' prop
- Prevent changing the actual signature of the DatePicker, avoiding breaking changes
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 12, 2021 20:49 Inactive
suzubara
suzubara previously approved these changes Mar 12, 2021
Copy link
Contributor

@suzubara suzubara left a comment

Choose a reason for hiding this comment

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

When comparing the rendered markup with the USWDS source, I noticed the USWDS passes these classes along into the DatePicker components:

usa-date-range-picker__range-start
usa-date-range-picker__range-end

that and the other comments I left are pretty minor. I tested this out on MilMove and it looks great!! nice work 🎉

src/components/forms/DateRangePicker/DateRangePicker.tsx Outdated Show resolved Hide resolved
- Use internal FormGroup and Label Compoents
- Pass in range-start and range-end classes to match USWDS
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 15, 2021 14:27 Inactive
- Populate from label and hint Ids when present
- Update tests to check that the airia-describedby property is properly filled.
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 15, 2021 16:22 Inactive
@brandonlenz
Copy link
Contributor Author

@suzubara your review prompted me to take a closer look at the generated markup. Looks like I missed the aria-describedby property on the internal and external inputs as well. Fixed in https://github.com/trussworks/react-uswds/pull/983/files/a77722bfeca340bf37934591ee8196dad3ab8a4b..cb45ebe7071e15a135ddcb1a47bcfbf372440d52

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 15, 2021 16:29 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 15, 2021 18:13 Inactive
suzubara
suzubara previously approved these changes Mar 15, 2021
Copy link
Contributor

@suzubara suzubara left a comment

Choose a reason for hiding this comment

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

🚀

@brandonlenz
Copy link
Contributor Author

@suzubara same story here. Had to merge main and resolve merge conflicts from main, so this will likely need another approval. Thanks for the reviews!

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook March 16, 2021 15:55 Inactive
@brandonlenz brandonlenz merged commit 69d34ed into main Mar 17, 2021
@brandonlenz brandonlenz deleted the bl-date-range-picker-339 branch March 17, 2021 16:55
brandonlenz added a commit that referenced this pull request May 12, 2021
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: Date Range Picker
4 participants