atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

feat(components): Calendar Date Picker

Open rjdestigter opened this issue 2 years ago • 6 comments
trafficstars

Motivations

Ticket: JOB-72836

This date picker implements the styles that came out of the Online Booking project are now also wanted for the Scheduling Recommendations project.

Added

Added a brand new component. Most code was ported over from the CalendarDatePicker used in the Jobber mobile app. I choose to port that over rather than fight with ReactDatePicker

CalendarDatePicker supports selecting single dates, multiple dates, and a date range.

image

^ 24 is selected and has keyboard focus while 31 has mouse hover styling

image

^ 1 has mouse hover styling

image

^ 2 has mouse hover styling

image

^ 2 is selected and has mouse hover styles applied while 9 is highlighted but has keyboard focus

https://github.com/GetJobber/atlantis/assets/14314519/02723574-8374-482d-87bf-4af5dbbb29c4

^ Today indicators on different states and with different interactions

https://github.com/GetJobber/Jobber/assets/14314519/9d2b2d0c-7d6c-4885-8a1f-72e6939b12aa

^ Range selection

Changed

This PR will not have the changes applied to InputDate and DatePicker (CalendarDatePicker + activator). I do have those changes ready to be PRed once this component is merged.

Testing

Storybook?


In Atlantis we use Github's built in pull request reviews.

image

rjdestigter avatar Oct 20 '23 00:10 rjdestigter

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 890465c
Status: ✅  Deploy successful!
Preview URL: https://bdc8bff6.atlantis.pages.dev
Branch Preview URL: https://calendar-date-picker-compone.atlantis.pages.dev

View logs

Ready for initial review, especially design review. A follow-up PR implements this for InputDate and I'll have another one for DatePicker (CalendarDatePicker + an activator)

I want to add some more tests for keyboard interactions but might look at upgrading @testing-libarary/user-events first

rjdestigter avatar Oct 20 '23 18:10 rjdestigter

I avoided making it dependant on date-fns as well. Not sure if we have thoughts on that. My opinion is that it's okay to have the few util functions defined by ourselves as part of the component. It doesn't add a lot of code and keeps the component dependency free.

rjdestigter avatar Oct 20 '23 19:10 rjdestigter

@rjdestigter re: dependency. i am in favour of that! this looks pretty cool tho! It's large, but cool!

darryltec avatar Oct 20 '23 19:10 darryltec

Could not publish Pre-release for 4580291980afcb1dd5cc109d83f3d9852e2fbcba. View Logs The problem is likely in the NPM Publish or NPM CI step in the Trigger Pre-release Build Job. .

github-actions[bot] avatar Oct 21 '23 01:10 github-actions[bot]

Todo: Implement style for todays date

rjdestigter avatar Oct 23 '23 19:10 rjdestigter