Skip to content

Conversation

@prateekmtri
Copy link

@prateekmtri prateekmtri commented Jan 5, 2026

Description

This PR addresses issue #1647.

I have implemented visual styling for "out-of-month" days in the Datepicker component. Days belonging to the previous or next month now appear faded (lower opacity and gray text) to distinguish them from the current month's days.

Changes

  • Updated Days.tsx to detect and style out-of-month days.
  • Added a new outside property in theme.ts to support customization.
  • Ensured selected dates retain their priority styling.

Fixes

Fixes #1647

Summary by CodeRabbit

  • New Features

    • Out-of-month dates in the Datepicker are now visually muted unless selected or disabled, improving month clarity.
  • Style

    • Added a theme token to control the muted "outside" date appearance.
  • Chores

    • Component schema now references components by full import paths (affects validation/resolution).
    • Tailwind content scanning list expanded to include an additional class-list path for style generation.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2026

⚠️ No Changeset found

Latest commit: e219b20

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 5, 2026

@prateekmtri is attempting to deploy a commit to the Bergside Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Adds detection and styling for out-of-month day cells in the Datepicker, a new theme token for "outside" day styling, updates the UI schema component enum to use source paths, and includes an additional Windows-style path in Tailwind content configuration.

Changes

Cohort / File(s) Summary
Datepicker view logic & theme
packages/ui/src/components/Datepicker/Views/Days.tsx, packages/ui/src/components/Datepicker/theme.ts
Add runtime isOutOfMonth check in Days view and apply a new outside theme class for out-of-month day cells (only when not selected/disabled). Add default token views.days.items.item.outside = "text-gray-500 opacity-40".
Schema: component enums
packages/ui/schema.json
Replace flat component name enum values with fully-qualified source path strings (e.g., "src\\components\\Accordion\\Accordion"), changing valid inputs and validation semantics for the components field. Review tooling/consumers that rely on previous simple names.
Tailwind content config
apps/web/tailwind.config.cjs
Add Windows-style path glob ".flowbite-react\\class-list.json" to the content array for Tailwind scanning.

Sequence Diagram(s)

(omitted — not applicable)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • SutuSebastian
  • rluders

Poem

🐰 I hopped through grids of days today,
Soft gray where neighbors gently sway,
Selections bright, the borders mild—
A clearer calendar, rabbit-styled! ✨

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Core objectives from #1647 are met: out-of-month styling applied with runtime check, theme token 'outside' added for customization, and selected styling priority maintained. However, unrelated changes to schema.json and tailwind.config.cjs are present. Remove schema.json enum changes and Windows path additions to tailwind.config.cjs; these are out-of-scope modifications unrelated to #1647 requirements.
Out of Scope Changes check ⚠️ Warning The PR includes unrelated changes: schema.json component enum replacement and tailwind.config.cjs Windows path glob addition that are not mentioned in issue #1647. Revert changes to schema.json and tailwind.config.cjs as acknowledged in PR comments; focus only on Days.tsx and theme.ts modifications for out-of-month styling.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main feature: adding styling for out-of-month days in the Datepicker component.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Fix all issues with AI Agents 🤖
In @apps/web/tailwind.config.cjs:
- Line 12: Remove the Windows-style glob entry
".flowbite-react\\class-list.json" and keep only the forward-slash variant
".flowbite-react/class-list.json" in the Tailwind content array; the backslash
escapes characters in fast-glob/node-glob patterns and breaks the glob, so
delete the backslash-escaped line (the literal
".flowbite-react\\class-list.json") and ensure only the forward-slash path
remains.

In @packages/ui/schema.json:
- Around line 12-114: The schema.json component enum currently lists
Windows-style paths (e.g., "src\\components\\Accordion\\Accordion") but the
generator (packages/ui/scripts/generate-metadata.ts) expects plain component
names from the componentToClassListMap keys; fix by regenerating the schema with
generate-metadata.ts (or update the enum entries) so values are simple
identifiers like "Accordion", "AccordionContent", etc., and ensure any path
handling in generate-metadata.ts uses normalized forward slashes before
extraction so the emitted enum matches the componentToClassListMap.

In @packages/ui/src/components/Datepicker/Views/Days.tsx:
- Around line 83-84: The condition that applies the out-of-month style currently
uses isOutOfMonth && !isSelected and therefore also fades disabled days; update
the condition where theme.items.item.outside is applied (in Days.tsx) to exclude
disabled days too (e.g., isOutOfMonth && !isSelected && !isDisabled) so that
disabled cells keep their standard disabled styling and are not double-faded.
🧹 Nitpick comments (1)
apps/storybook/tailwind.config.cjs (1)

6-10: Multi-line formatting improves readability.

The expansion to a multi-line array format is a good readability improvement.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbca07b and e1ffbe3.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • apps/storybook/tailwind.config.cjs
  • apps/web/tailwind.config.cjs
  • packages/ui/schema.json
  • packages/ui/src/components/Datepicker/Views/Days.tsx
  • packages/ui/src/components/Datepicker/theme.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-01T10:45:00.071Z
Learnt from: SutuSebastian
Repo: themesberg/flowbite-react PR: 1621
File: packages/ui/src/cli/commands/install.ts:46-48
Timestamp: 2025-09-01T10:45:00.071Z
Learning: In the flowbite-react CLI install command, the maintainer prefers a simple Windows support implementation that appends .cmd to all commands on win32, rather than a more defensive approach, because they know the command will only be package managers from the resolveCommand function.

Applied to files:

  • apps/web/tailwind.config.cjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: 🧰 Build
🔇 Additional comments (5)
apps/storybook/tailwind.config.cjs (1)

9-9: Verify necessity of Windows-style path duplication.

As with apps/web/tailwind.config.cjs, adding an explicit Windows-style path variant (.flowbite-react\\class-list.json) alongside the Unix-style path may be unnecessary. Modern Tailwind CSS handles forward slashes universally across platforms.

This change also appears unrelated to the PR objectives about datepicker styling.

Based on learnings, the maintainer prefers simple Windows support, but that context was for CLI command execution (appending .cmd), not path specifications in config files where forward slashes are typically universal.

packages/ui/src/components/Datepicker/theme.ts (1)

53-53: LGTM! Theme token aligns with PR objectives.

The new outside property with "text-gray-500 opacity-40" provides the muted styling for out-of-month days as specified in the requirements. The Tailwind v4 syntax is correct and will properly apply gray text color with 40% opacity.

packages/ui/src/components/Datepicker/Views/Days.tsx (3)

28-28: LGTM! Theme interface correctly extended.

The outside property addition to DatepickerViewsDaysTheme properly supports the new styling feature and aligns with the theme definition in theme.ts.


70-71: LGTM! Month comparison correctly handles out-of-month detection.

The logic correctly identifies days outside the current month by comparing getMonth() values. This handles cross-year boundaries properly (e.g., December 2025 → January 2026, January 2025 → December 2024).


101-101: LGTM! DisplayName follows React conventions.

The component's display name is properly set for debugging and React DevTools.

Copy link
Collaborator

Choose a reason for hiding this comment

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

undo Windows specific changes here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

undo changes

@prateekmtri
Copy link
Author

Thanks for the review @SutuSebastian.

I've noted the feedback regarding the Windows paths, schema reversion, and cleanup of comments. I will work on these fixes and update the PR shortly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @apps/web/tailwind.config.cjs:
- Line 12: Replace the Windows-style escaped path string
".flowbite-react\\class-list.json" in the Tailwind content array with the
cross-platform forward-slash form ".flowbite-react/class-list.json" (undo the
previous Windows-specific change) so the Tailwind content glob matches correctly
across platforms.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4586d7a and eb29e98.

📒 Files selected for processing (4)
  • apps/web/tailwind.config.cjs
  • packages/ui/schema.json
  • packages/ui/src/components/Datepicker/Views/Days.tsx
  • packages/ui/src/components/Datepicker/theme.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui/src/components/Datepicker/Views/Days.tsx
  • packages/ui/src/components/Datepicker/theme.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-01T10:45:00.071Z
Learnt from: SutuSebastian
Repo: themesberg/flowbite-react PR: 1621
File: packages/ui/src/cli/commands/install.ts:46-48
Timestamp: 2025-09-01T10:45:00.071Z
Learning: In the flowbite-react CLI install command, the maintainer prefers a simple Windows support implementation that appends .cmd to all commands on win32, rather than a more defensive approach, because they know the command will only be package managers from the resolveCommand function.

Applied to files:

  • apps/web/tailwind.config.cjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: 🧰 Build
🔇 Additional comments (1)
packages/ui/schema.json (1)

12-114: Revert the schema component enum changes as instructed by the maintainer.

The maintainer explicitly requested to "undo changes" to this file, and you acknowledged you would revert the schema changes. These Windows-style path values are inconsistent with how the schema generation script works and should be reverted to simple component names.

Likely an incorrect or invalid review comment.

@prateekmtri
Copy link
Author

Fixed the formatting issues. All CI checks are passing now. Ready for re-review! 🚀

@SutuSebastian
Copy link
Collaborator

Fixed the formatting issues. All CI checks are passing now. Ready for re-review! 🚀

Not exactly, u resolved my comments in 4586d7a, but then reverted the windows // forward slash changes in the following eb29e98.

If u need to format the files, just run bun run format at the package level or at the root level.

@prateekmtri
Copy link
Author

Thanks for pointing that out @SutuSebastian — got it 👍
The Windows-style path was accidentally reintroduced during formatting. I’ll fix it and resolve the remaining issue shortly.

@prateekmtri
Copy link
Author

Reverted the changes in schema.json and removed the Windows-style path from tailwind.config.cjs. Also ran bun run format. Ready for re-review!

Copy link
Collaborator

Choose a reason for hiding this comment

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

for the last time, undo

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.

Support out-of-month days style

2 participants