Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
These changes allow for more flexible styling
Motivation and Context
We're using the calendar to select start and end dates for holiday bookings (unsurprisingly!)
At present the calendar only has a single "invalid" class for dates that cannot be selected. This is generally fine but for better UX, we may wish to differentiate days that are not technically sold out, but perhaps don't meed certain rules. e.g. a given property may only allow check-in's on Saturdays. All other days of the week are invalid for selection but that doesn't mean they are sold out.
But allowing a callback which can be used to apply custom class names to the days, we can allow great downstream flexibility.
I've also added some more generic classes to the various objects. This allows for general purpose styling without having to override the components.
How Has This Been Tested?
I have written a storybook entry for this change which adds the odd or even class to each day and a little inline style to see this in action.
I have also incorporated this into another project which uses it in a more complex way.
Types of changes