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

feat: add time-picker #2583

Merged
merged 26 commits into from
Jul 24, 2024
Merged

Conversation

colinlienard
Copy link
Contributor

@colinlienard colinlienard commented Jun 18, 2024

Add the TimePicker component
Continuation of chakra-ui/zag#1415

  • React
    • Component
    • Examples
    • Tests
  • Solid
    • Component
    • Examples
    • Tests
  • Vue
    • Component
    • Examples
    • Tests
Copy link

vercel bot commented Jun 18, 2024

@colinlienard is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

@colinlienard colinlienard force-pushed the feat/time-picker branch 3 times, most recently from b97effb to 1a7c336 Compare June 24, 2024 16:18
@colinlienard colinlienard marked this pull request as ready for review July 3, 2024 15:57
Copy link

vercel bot commented Jul 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ark-docs ✅ Ready (Inspect) Visit Preview Jul 19, 2024 1:47pm
@cschroeter
Copy link
Member

@colinlienard

Thanks a lot for working on this! I've started reviewing the PR, and it looks very promising. I'm debating whether we should have a dedicated anatomy part for each Cell (like hour, minute, etc.) or simply rely on the already existing data-unit="[hour|minute|second]" attribute for styling. What are your thoughts on this?

@colinlienard
Copy link
Contributor Author

At the start I was thinking that is was more straightforward to have HourCell, MinuteCell, etc but it might be confusing in the dom because they would all have the data-part="cell" and not data-part="hour-cell" etc.
Also, the Column component has a unit props, so it may be more consistent to have the same prop on a Cell component.
So I would be keen to delete HourCell, MinuteCell, etc and have just a Cell with a unit prop.

What do you think @cschroeter?

@cschroeter
Copy link
Member

@colinlienard

I've reviewed the PR, and it looks great! Excellent work!

However, I noticed some issues when forcing a 24h locale, like <TimePicker.Root locale="de-DE" />, so I need to debug this with @segunadebayo.

I'd like to simplify the API a bit. The unit on the column should be sufficient for the Cell to know its type.

Before:

<TimePicker.Column unit="hour">
  <TimePicker.Spacer />
  {api.getHours().map((item) => (
    <TimePicker.HourCell key={item.value} value={item.value}>
      {item.label}
    </TimePicker.HourCell>
  ))}
  <TimePicker.Spacer />
</TimePicker.Column>

After:

<TimePicker.Column unit="hour">
  <TimePicker.Spacer />
  {api.getHours().map((item) => (
    <TimePicker.Cell key={item.value} value={item.value}>
      {item.label}
    </TimePicker.Cell>
  ))}
  <TimePicker.Spacer />
</TimePicker.Column>

But that's something I can handle myself. Thank you again for your flawless contribution!

@pierresisson
Copy link

@colinlienard

I've reviewed the PR, and it looks great! Excellent work!

However, I noticed some issues when forcing a 24h locale, like <TimePicker.Root locale="de-DE" />, so I need to debug this with @segunadebayo.

I'd like to simplify the API a bit. The unit on the column should be sufficient for the Cell to know its type.

Before:

<TimePicker.Column unit="hour">
  <TimePicker.Spacer />
  {api.getHours().map((item) => (
    <TimePicker.HourCell key={item.value} value={item.value}>
      {item.label}
    </TimePicker.HourCell>
  ))}
  <TimePicker.Spacer />
</TimePicker.Column>

After:

<TimePicker.Column unit="hour">
  <TimePicker.Spacer />
  {api.getHours().map((item) => (
    <TimePicker.Cell key={item.value} value={item.value}>
      {item.label}
    </TimePicker.Cell>
  ))}
  <TimePicker.Spacer />
</TimePicker.Column>

But that's something I can handle myself. Thank you again for your flawless contribution!

hi @cschroeter when do you plan to release this feature? let us know if we can help on this topic ! :)

@cschroeter
Copy link
Member

@colinlienard @pierresisson

I've updated the React portion but I'm running out of time for Solid and Vue. If you can take those, that would be great.

@cschroeter cschroeter merged commit 7986864 into chakra-ui:main Jul 24, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants