Skip to content

Dynamic max events and Month View refactor | Beta version#47

Merged
Jaganath-MSJ merged 20 commits intobetafrom
dev
Feb 16, 2026
Merged

Dynamic max events and Month View refactor | Beta version#47
Jaganath-MSJ merged 20 commits intobetafrom
dev

Conversation

@Jaganath-MSJ
Copy link
Copy Markdown
Owner

Summary

This PR implements dynamic calculation of maxEvents based on the container's height and refactors the MonthView component to use a discriminated union pattern for better type safety and modularity.

Changes

  • src/Calendar.tsx:
    • Implemented ResizeObserver to auto-calculate maxEvents.
    • Refactored view rendering logic to support the new discriminated union structure.
  • src/views/month/MonthView.tsx: Refactored Month View logic for + more Popover.
  • src/utils/common.ts: Updated helper functions for max events calculation.
  • playground/src/App.tsx: Updated playground to support dynamic sizing tests.
  • release.config.cjs: Updated release configuration.

Verification

  • Validated dynamic sizing validation in the playground.
  • Verified Month View rendering with the new structure.

Jaganath-MSJ and others added 20 commits February 11, 2026 07:59
fix date selection logic and dependency arrays | Standard Version
## [1.1.1](v1.1.0...v1.1.1) (2026-02-11)

### Bug Fixes

* fix date selection logic and dependency arrays ([78aa7e7](78aa7e7))
- Remove maxEvents from CalendarContentType interface as it's now computed dynamically
- Fix conditional logic in EventItem to properly handle endDateWeek and endDate
- Enhance calculateMaxEvents to accept rowsInView parameter for better flexibility
- Compute maxEvents in CalendarContent using memoized calculation based on calendar grid rows
- Simplify Calendar component by moving maxEvents calculation to CalendarContent
- Update calendar-simple from version 1.1.0 to 1.1.1 in package.json and lock file
- Replace static demo events with dynamic, date-relative events for better testing
- Make calendar container responsive using viewport units
- Set selectedDate to current date and add maxEvents prop for demonstration
- Extract hardcoded values into CALENDAR_CONSTANTS object
- Update EventItem, Calendar, and utility functions to use centralized constants
- Improve maintainability by eliminating magic numbers across components
Add smart positioning logic to prevent popover from overflowing screen edges.
Increase popover dimensions and add scrollable content area for better event display.
Make maxEvents required in DateDataType interface to ensure consistent behavior.
Add type annotations to week and day parameters in map callbacks for better type safety and improved IDE support.
- Create Storybook configuration files (main.ts, preview.ts) with proper TypeScript support
- Add Calendar component stories with comprehensive examples and controls
- Configure Vite build to conditionally exclude type generation during Storybook builds
- Add necessary dependencies and scripts for Storybook development and build
- Create type declaration file for Storybook module resolution
Update @types/node, @types/react, @types/react-dom, esbuild, prettier, semantic-release, and typescript to their latest compatible versions to maintain security and leverage latest features and fixes.
… versions

Update react and react-dom to ^19.2.4 for bug fixes and improvements.
Update dev dependencies including eslint, typescript packages, and vite to
their latest compatible versions to maintain security and toolchain stability.
- Add 'docs' and 'storybook-static' to .gitignore to exclude generated documentation and Storybook builds
- Significantly expand the demo event data in the playground to include more diverse scenarios:
  - Overlapping events to test visual rendering
  - Long-duration and cross-month events
  - Events from previous and next months
  - Single-day deadlines and multi-day tasks
- Remove the `maxEvents` prop from the Calendar component in the demo to display all events
Use fixed positioning to ensure popover stays within viewport boundaries.
Anchor the popover to the "more events" button element and calculate
position relative to viewport with overflow detection for both vertical
and horizontal axes. This prevents the popover from being cut off by
scroll containers and ensures consistent placement.
Only include @semantic-release/git plugin for non-prerelease branches to avoid unnecessary commits during prerelease builds.
- Remove deprecated convertToDayjs function and replace with dateFn
- Extract common date operations into named utility functions (formatDate, getDiffDays, addMonths, etc.)
- Update all components to use new utility functions instead of chained dayjs methods
- Improve type safety with DateInputType union
- Maintain same functionality while reducing dayjs API surface exposure
Simplify event handling by making DataTypeList a discriminated union that explicitly distinguishes between regular events and spacer events. This eliminates conditional checks for optional properties and ensures type safety throughout the codebase.

- Replace interface with union type separating spacer and non-spacer events
- Make startDateWeek required for non-spacer events
- Remove fallback logic in EventItem since startDateWeek is now guaranteed
- Add internal type helper with _tempId for slot calculation
- Update slot lookup to use non-null assertion for type safety
- Use CalendarType['onEventClick'] in Popover to match parent interface
- Remove duplicate onMonthChange prop from CalendarContent and use from restProps
- Extend HeaderProps from CalendarType to ensure type safety and reduce duplication
Consistent use of function declarations improves hoisting behavior and aligns with team style preferences. This change affects utility functions across date handling, calendar logic, and hooks.
Dynamic max events and Month View refactor
@Jaganath-MSJ Jaganath-MSJ merged commit 57e3c3a into beta Feb 16, 2026
3 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants