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
[Timeline] Introduce new component #21331
Conversation
@material-ui/lab: parsed: +2.56% , gzip: +1.49% Details of bundle changes.Comparing: 1f18002...a7c8b3f Details of page changes
|
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
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.
Great start!
- We need to update https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/index.d.ts
- We need to update https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/index.js
- I think that we could have a dedicated demo for changing the color. https://ant.design/components/timeline/#components-timeline-demo-color
- It would be great to have a h2 section in the documentation for the dot variant outlined (pretty cool)
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
packages/material-ui-lab/src/TimelineItemDot/TimelineItemDot.js
Outdated
Show resolved
Hide resolved
A new thought, should we make the component names "denser", turning <Timeline>
<TimelineItem>
<TimelineItemTail />
<TimelineItemDot />
<TimelineItemContent>Code</TimelineItemContent>
</TimelineItem>
</Timeline> into? <Timeline>
<TimelineItem>
<TimelineTail />
<TimelineDot />
<TimelineContent>Code</TimelineContent>
</TimelineItem>
</Timeline> |
@oliviertassinari here is how the API looks at the moment - I have denser component names, and additional component around the <TimelineItem>
<TimelineSeparator>
<TimelineDot />
<TimelineConnector />
</TimelineSeparator>
<TimelineContent>Code</TimelineContent>
</TimelineItem> |
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.
Looking good. Just had a quick look - will have a thorough look tomorrow.
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 really like this API. Especially since you didn't start with a high level API where you just pass in some items to a single component. Instead you start with multiple components that are composed into one rich UI. And the demos then show how one could abstract the data into a single variable (e.g. in "Opposite content").
My only issue is that all components have a component
prop. Since we don't have any documented use case I'd remove it for now. Especially since the default has semantics (e.g. ul
in Timeline
). It's always easier to add a prop later or maybe find a better implementation for a specific use case than removing a prop because it's used wrong.
What's going to be interesting is how accessibility looks for this component.
Either way great work!
Here is an example of customizing the component. You can learn more about this in the | ||
[overrides documentation page](/customization/components/). | ||
|
||
{{"demo": "pages/components/timeline/CustomizedTimeline.js"}} |
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'm leaving a not for later, so far, in the ## Customized X
headers of the documentation, we have always tried to show an example that significantly diverges from Material Design. It could potentiation make sense to follow suit here. but IMHO, it's already good enough right now to be merged like this :)
@eps1lon thanks for the review, removed component props. |
// | To update them edit the d.ts file and run "yarn proptypes" | | ||
// ---------------------------------------------------------------------- | ||
/** | ||
* The position where the timeline should appear. |
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.
This is a bit confusing for me. The timeline is being referred to as the visible line in the documentation so how can it have alternating alignment? I think this is what caused me some initial confusion when looking at the right aligned timeline example - I instantly associated alignment with text so when the text was aligned on the left it seemed weird until I read the description. Maybe something like eventAlignment= left | right | alternating would be better, I'm not sure.
This to me doesn't have to be changed straight away or maybe at all just something I noticed :)
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 got the inspiration for this prop from other UI libraries actually...
- ant design has the property
mode="right"
which is displaying the same thing - react suite also has the align property -
align="right"
for the similar thing
Maybe eventAlignment
is more specific and won't introduce this confusion... Anyway, let me know you final thoughts and I can update it.
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.
@joshwooding From my perspective, we are good. If we consider how the CSS text-align property work, it sounds identical.
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.
@oliviertassinari I’m not sure I quite understand your point my point was changing the alignment of the timeline to alternating makes no sense when referring to the visible line as the timeline? text-align specifies in the name what is being aligned? Alternating text alignment makes sense to me alternating line alignment doesn’t...
@mnajdova
Mode makes more sense in this context but I prefer alignment better as a concept, react-suite calls it align but the prop description is different so maybe that’s the middle ground in keeping the prop name and clearing up the meaning?
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.
text-align specifies in the name what is being aligned
Interesting, I guess we might have abused on the shorthand with TableCell.align and Typography.align prop names.
* The position where the timeline should appear. | |
* The position where the timeline's content should appear. |
@joshwooding I updated that example to only contain the alternating Timeline, checked on mobile, looks good now.. |
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
cf71bba
to
4b9f95d
Compare
Co-authored-by: Josh Wooding <12938082+joshwooding@users.noreply.github.com>
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.
Everything looks good, still have some concerns on the align prop though have added some more context above. Looks like changing the prop description to closer match react-suite is an easy fix.
@mnajdova Great job 🙏 |
@mnajdova Great work 🎉 |
wow, that is cool, it's just what I needed to my webapp, but had to develop it by myself see it's use case: HERE |
Nice job. Gives me a few potential enhancement ideas for this one...
|
Documentation page: https://deploy-preview-21331--material-ui.netlify.app/components/timeline/