-
Notifications
You must be signed in to change notification settings - Fork 32
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(DatePickerE): Initial updates based on v3 design spec #2841
Conversation
8ad333d
to
07344a5
Compare
d9777c7
to
d848307
Compare
020125c
to
8a62cc5
Compare
@@ -153,20 +161,20 @@ export const DatePickerE: React.FC<DatePickerEProps> = ({ | |||
> | |||
<StyledOuterWrapper | |||
data-testid="datepicker-outer-wrapper" | |||
$hasFocus={open} | |||
$hasFocus={hasFocus && !hasError} |
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.
The && !hasError
is temporary here to preserve the existing behaviour (which is covered by tests). It will be reviewed as part of #2863.
|
||
const { color } = selectors | ||
|
||
export const StyledFloatingBox = styled(FloatingBox)` |
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've left these as overrides for now as it's not yet clear if these will be directly applicable anywhere else.
8a62cc5
to
4468e51
Compare
4468e51
to
98289e3
Compare
@k9dh3zij I've added the outer shadow to the calendar sheet. Please have a look if it's as intended, as how it looks will depend on the origin (in relation to the other borders and shadows). |
Thanks @jpveooys loving this! Feedback: Visual
Keyboard controls
That's all for now, I think 😅 Thanks! |
disabled={isDisabled} | ||
data-testid="datepicker-input-button" | ||
> | ||
<StyledSeparator /> | ||
<DropdownIndicatorIcon isOpen={open} /> | ||
<StyledIconCalendarWrapper> |
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.
Just noticed StyledIconCalendarWrapper
is misnamed – will rename to StyledIconEventWrapper
.
I've made updates to address those except for the following two:
There was an issue already open in the underlying library we're using (react-day-picker) regarding this. I've created a separate issue #2871 at our end with more info and responded to the issue in the underlying library.
I found a library that will add this behaviour (called a 'focus trap'). However, it has a bug where the tab key stops functioning when dates after the first of the month are focused, so I've left that change out and created a separate issue (#2870). I also need to report the bug upstream. Regarding:
I've added this but note it's not possible at the moment to clear that highlight when tabbing away with react-day-picker v7 (it will be with v8 which is currently in beta). (Have created a separate issue for this as well: #2872.) I also updated the border radius of the sheet and the hover/pressed/focus styles of the next and previous month buttons, as they seemed wrong before to me. Have another look at those if you can 🙂 |
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.
Looks good 👍
@@ -605,6 +605,32 @@ describe('DatePickerE', () => { | |||
expect(wrapper.getByText('December 2019')).toBeInTheDocument() | |||
}) | |||
|
|||
describe.each([ |
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.
👌
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.
LGTM - just a couple of tiny comments
packages/react-component-library/src/components/DatePickerE/DatePickerE.tsx
Show resolved
Hide resolved
packages/react-component-library/src/components/TextInputE/TextInputE.test.tsx
Show resolved
Hide resolved
Good spot! Have updated those. |
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.
👍
Thanks for the updates @jpveooys looking great! As discussed, something that we can look to improve when the react-day-picker library allows it, please: Big 👍 from me on this! :) |
Thanks @k9dh3zij ! It looks like that's covered by gpbl/react-day-picker#1320 which was coincidentally opened 30 minutes ago 😄 |
Update general styling based on the v3 design spec. Includes removing the `isValid` prop.
Make the placeholder big when the input is empty, and don't automatically open the picker when the input is focused. Also append the date format to the label automatically.
Update the styling of the floating box using overrides. (Currently not clear if these styles are applicable for anything else, therefore they are left as overrides for now.)
Add shading of intermediate days on hover, and use a consistent order for the selection of the start and end dates.
2f1b21f
to
a5bdb12
Compare
Kudos, SonarCloud Quality Gate passed! |
Related issue
Resolves #2439
Overview
This makes various updates to the DatePickerE component based on the v3 design spec.
Link to preview
Storybook
Non-Storybook example
(base font size overridden to 100% due to Review the need for font breakpoints and remove if not needed #2761)
Reason
Incremental work towards the v3 release.
Work carried out
isValid
propDemo
Single date
Range
Developer notes
Does not include: