-
Notifications
You must be signed in to change notification settings - Fork 831
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
[vNext] Redesing to material-ui 2.0 #1416
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -127,15 +181,11 @@ CalendarHeader.displayName = 'CalendarHeader'; | |||
CalendarHeader.propTypes = { | |||
leftArrowIcon: PropTypes.node, | |||
rightArrowIcon: PropTypes.node, | |||
disablePrevMonth: PropTypes.bool, | |||
disableNextMonth: PropTypes.bool, | |||
}; | |||
|
|||
CalendarHeader.defaultProps = { |
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.
Have you considered to use the prop spread default values instead of default props?
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.
It is primarily used for typescript typings. This is just so old code, will move it. (But there is a problem with auto generating default props values)
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.
We might have a solution for this. The default props generation for API purpose was solve in the mui-org/material-ui repository. @eps1lon took care of it.
It's a good reminder that we need to look into how we can extract the API from TypeScript sources, and not only JavaScript ones.
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.
Right now I created custom script that reads jsdoc tags on props like @default "someValue"
and primarily use it and getting rid from default props.
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.
Our handler for react-docgen
and default props via default values in object rest spread can be found in https://github.com/mui-org/material-ui/blob/6f7318cdd5c1c2887860c0d56212a3e42d107082/docs/src/modules/utils/defaultPropsHandler.js#L8
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.
@eps1lon don't you use react-docgen-typescript
?
Co-Authored-By: Olivier Tassinari <[email protected]>
(haha I am seeing that keyboard navigation is stopping after the animation, I suppose the problem is losing focus. Looks like we need a global useKeyDown) |
Unrelated, we might have an opportunity to improve a11y. I was wondering about the usage of grid roles for the day grid: https://www.w3.org/TR/wai-aria-practices/#table.
|
Addressed some feedback:
|
Also, I am planning to render 4 years in the column for desktop pickers. For mobile it is too much cause touch targets will be too small.
<DatePicker
// We are passing already rendered day node right to the override function. Super usefull for adjustign rendering
renderDay={(day, selectedDate, isInCurrentMonth, dayComponent) => {
const isSelected = isInCurrentMonth && selectedDays.includes(date.getDate());
return <Badge badgeContent={isSelected ? '🌚' : undefined}>{dayComponent}</Badge>;
}}
/>
|
I think this should be ready to go? Moving to some work in date-io 💪 |
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.
One step at the time 👍
This PR is a part of v4 development (#1293)
Description
Note that new layout for mobile/desktop variant will be in the next PR, here just changing everything inside the components.