jolbol1 / jolly-ui

shadcn/ui compatible react aria components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://jollyui.dev
MIT License
538 stars 13 forks source link

getting error with date range picker #36

Open newbeelearn opened 3 weeks ago

newbeelearn commented 3 weeks ago

i have installed jollyui in /components/jolly-ui folder and all the jolly-ui components are here shadcn components are in /components/ui folder.

what is this @/registry/default ? referring to shadcn dependency or jollyui dependency? also there are other dependencies like date-fns these were not installed when installing the component with sly is this expected?

jolbol1 commented 2 weeks ago

Hi, Those are other components that need to be installed. The imports need to be changed to the directory you would install those components in.

I need to look in to if there is a way to fix this using the CLI, as I'm not sure there is at the moment unless I go with a custom solution.

If I cant find a way I will try to add better documentation. Date-fns should be installed and is missing from the registry so will fix that. Cheers for the report.

newbeelearn commented 2 weeks ago

Thanks for responding i have few more suggestions for improvement, please think about them as well. i think since we are using react-aria it would be better to use https://react-spectrum.adobe.com/internationalized/date/DateFormatter.html instead of date-fns it will also avoid unnecessary dependency since we are already installing react-aria. Also i had to remove fixed px and modify the component just to override the size of datebutton , if fixed sizes are not used it would improve the reusability of components.

jolbol1 commented 1 week ago

I see what you mean on the button sizing, will look at modifying that behaviour.

In terms of removing date-fns, I left it this way as its the only way to get the date format the same as shadcn/ui, the closest DateFormatter can get you is June 6, 2024, so without the suffixes (th, st) etc.

All that being said however, I am planning on redoing the date picker component a bit to better support react-arias features. This will mean instead of being a button it will offer an input as well. This in my opinion is a better UX. I will plan on providing shadcn clone code examples though.

newbeelearn commented 1 week ago

All that being said however, I am planning on redoing the date picker component a bit to better support react-arias features

that would be great Right now i have moved date related formatting out of component as i need different formatting i.e. if its same year than year need not be depicted like jun 1-jun 18, etc. these are specific to application in hand. This is just one data point but my guess is other users would also have similar needs may be have an option to override these when you are redoing it.