-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Update Calendar Component for [email protected] Compatibility #6630
base: main
Are you sure you want to change the base?
Update Calendar Component for [email protected] Compatibility #6630
Conversation
Upgraded react-day-picker library to ^9.5.1, replacing outdated classes and adapting new class names and structure. Updated components and styles to align with the latest changes in the library. - Replaced `ChevronLeft` and `ChevronRight` with `ChevronLeftIcon` and `ChevronRightIcon`. - Adjusted class names in `DayPicker` to match updated API (e.g., `caption` → `month_caption`, `table` → `month_grid`). - Improved button and navigation styles with updated structure (`nav_button` split to `button_previous` and `button_next`). - Updated documentation to reflect new installation and usage instructions.
@HichemTab-tech is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
…t-day-picker-9' into upgrade-calendar-to-support-react-day-picker-9
Thanks @HichemTab-tech, this is very welcome! |
Thanks, glad to hear that ;) |
Hi @HichemTab-tech I see some other PR #4421 Have ability to do this, may you can implement to (add give applause to all another PR)
or |
@adiramardiani Thanks for the suggestion! I’ll definitely use that, but I think it’s best to keep this in a separate PR, and I’ll start working on it right away. The reason is that this PR is focused on upgrading the Shadcn Calendar component to support Now that the documentation clarifies the version requirement, this PR ensures proper support for As we say, compatibility comes first! But I really really appreciate the idea and the references—I’ll start working on it in the feature PR immediately. 🚀 |
What's the status on this one? 🙏 |
@HichemTab-tech Does this issue happen? Screen.Recording.2025-02-24.at.15.34.20.mov |
Nop, I already fixed it in this PR. |
hmmm 🤔 , use tailwind 4? |
- Moved `buttonVariants({ variant: "ghost" })` inside the `day` class definition to ensure consistent style application across components. - Updated hover states for `today` to align with `primary` styles, improving visual coherence. - Adjusted `outside` and `day-outside` styles for clearer differentiation and better UX. - Refactored class names for readability and maintainability.
- Simplified icon import definitions by reducing line breaks for readability and consistency. - Modified `day_button` styles in calendar components to use a single-line `cn` function for better code compactness and clarity.
- Refactored Menubar components to replace complex `forwardRef` declarations with simpler function components for cleaner and more maintainable code. - Updated `day_button` styling in the calendar to a single-line `cn` function, improving readability and consistency. - Added minor tweaks to Menubar styling for alignment and visual adjustments.
# Conflicts: # apps/v4/registry/new-york-v4/ui/calendar.tsx # apps/www/public/r/styles/new-york-v4/calendar.json
- Removed unnecessary newline in the 'outside' class definition in `calendar.tsx`. - Aligned `calendar.json` content to match updated styling, improving consistency.
Ah you're right, seems like they have a separated build script for the v4, i had to run it manually, thanks for notifiyng me, I fixed it now. |
hi @HichemTab-tech i have fixing some style
|
- Replaced "space-y" with "gap" for better spacing semantics. - Updated class naming to enhance readability and maintainability. - Adjusted dimensions and layout for improved visual alignment. - Simplified day selection logic for easier customization and styling. Co-authored-by: @dstrygwyr <strygwyr>
Thanks @dstrygwyr ;) |
Description:
This PR updates the
Calendar
component to support[email protected]
, which introduced breaking changes. The update includes:Changes Implemented:
react-day-picker
from 8.10.1 to 9.5.1 (Released: 2024-07-20) following the official upgrade guide.months
,nav
,nav_button
,table
, and related class names to align with DayPicker's new styling approach.ChevronLeft
andChevronRight
withChevronLeftIcon
andChevronRightIcon
fromlucide-react
.Chevron
component that dynamically renders the appropriate icon based on orientation.date-fns
fromregistry.json
dependencies, as perreact-day-picker
's latest requirements.Why This Update?
The latest
react-day-picker
introduced several breaking changes, particularly in how styles and dependencies are handled. This update ensures theCalendar
component remains functional and maintains styling consistency while following best practices.Checklist:
react-day-picker
to 9.5.1 and refactored usage.date-fns
). (Source: https://daypicker.dev/upgrading#1-upgrade-to-the-latest-version)pnpm --filter=www dev
).pnpm test
).Impact:
This update ensures the
Calendar
component remains compatible with the latestreact-day-picker
, aligns with the latest best practices. Let me know if any further refinements are needed!