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

Timeline component #89

Merged
merged 13 commits into from
May 25, 2022
Merged

Timeline component #89

merged 13 commits into from
May 25, 2022

Conversation

joeychrys
Copy link
Contributor

Ref: This PR is related to issue #12

@joeychrys joeychrys changed the title WIP: Timeline component Timeline component May 19, 2022
@joeychrys joeychrys marked this pull request as ready for review May 19, 2022 01:40
Copy link
Collaborator

@rluders rluders left a comment

Choose a reason for hiding this comment

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

I think that just one small change..

src/docs/pages/TimelinePage.tsx Outdated Show resolved Hide resolved
@joeychrys joeychrys requested a review from rluders May 21, 2022 06:51
@rluders
Copy link
Collaborator

rluders commented May 21, 2022

@tulup-conner @bacali95 this one is a big one... May we have +1 review at least?

@rluders rluders requested a review from bacali95 May 21, 2022 07:34
src/docs/pages/TimelinePage.tsx Outdated Show resolved Hide resolved
src/lib/components/Timeline/Timeline.stories.tsx Outdated Show resolved Hide resolved
src/lib/components/Timeline/TimelineItem.tsx Show resolved Hide resolved
<div data-testid="timeline-point" className={classNames({ 'flex items-center': horizontal })} {...props}>
{children}
{Icon ? (
<span className="absolute -left-3 flex h-6 w-6 items-center justify-center rounded-full bg-blue-200 ring-8 ring-white dark:bg-blue-900 dark:ring-gray-900">
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to either not be visible to screen readers, or pass in an accessible name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to either not be visible to screen readers, or pass in an accessible name

You might have to give me hand on this one. I'm not sure what the best way to do this is. :(

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably just add the sr-only class (hide this icon for screen readers) since each icon will be accompanied by relevant text already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would probably just add the sr-only class (hide this icon for screen readers) since each icon will be accompanied by relevant text already.

Okay so do I just add the sr-only class and make it a conditional based on whether or not there is an Icon. This would also replace the ternary statement right?


export const TimelineTitle: FC<TimelineTitleProps> = ({ children, ...props }) => {
return (
<h3 className="text-lg font-semibold text-gray-900 dark:text-white" {...props}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be morphable into any heading level

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be morphable into any heading level

Should I make a prop called tag that is passed to the heading level. The user can then only pass in a range from 1-6 to the tag prop?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Its a pretty common pattern to provide an as prop, like:

as="h5"

@tulup-conner
Copy link
Collaborator

Sorry, I created confusion by suggesting sr-only where I meant aria-hidden="true" which have the opposite effect 😂

@bacali95
Copy link
Collaborator

I think this PR is ready to go, do you have other requests @rluders @tulup-conner?

@rluders rluders merged commit 87df117 into themesberg:main May 25, 2022
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.

4 participants