feat!: MonthView out-of-range navigation + rename overflowBehavior → outOfRangeBehavior#22
Merged
Merged
Conversation
…havior → outOfRangeBehavior MonthView's `overflowBehavior` prop was inert — the prev/next buttons ignored it and never disabled at the `min`/`max` bounds. Wire it into `useNavButton`: `"stop"` disables navigation once the destination month crosses the boundary, while `"unbounded"` (default) leaves paging unrestricted (out-of-range days still render disabled). Also rename the prop and its types for discoverability — `overflowBehavior` didn't convey that it bounds the *view*, not selection: - prop `overflowBehavior` → `outOfRangeBehavior` (MonthView + WeeksView) - type `OverflowBehavior` → `OutOfRangeBehavior` - type `MonthOverflowBehavior` → `MonthOutOfRangeBehavior` TSDoc on the prop and types is expanded to explain the view-vs-selection distinction and each value (including when `snap`/`snap-shrink` diverge). BREAKING CHANGE: `overflowBehavior` is renamed to `outOfRangeBehavior`, and the exported `OverflowBehavior`/`MonthOverflowBehavior` types become `OutOfRangeBehavior`/`MonthOutOfRangeBehavior`. Accepted values are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for colander-cal ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…fRangeBehavior
The public prop and types were renamed to `outOfRangeBehavior` /
`OutOfRangeBehavior` / `MonthOutOfRangeBehavior`, but the internal mechanism
still used "overflow" naming. Align it:
- overflow.ts → out-of-range.ts (+ overflow.test.ts → out-of-range.test.ts)
- applyOverflow → applyOutOfRange
- ApplyOverflowInput → ApplyOutOfRangeInput
- overflowResult → outOfRangeResult
- update imports + behavior-referring comments; regenerate format subpaths
Temporal's `{ overflow: "constrain" }` option (PlainDate.from etc.) is
unrelated and left as-is.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two changes to the navigation-bounding prop, bundled because the rename must be atomic across the library and the docs site.
1. MonthView
outOfRangeBehaviornow actually works (audit M5)The prop was inert on
MonthView— prev/next buttons ignored it and never disabled atmin/max. It's now wired intouseNavButton:"unbounded"(default) — paging is never restricted bymin/max; out-of-range days still render disabled."stop"— prev/next disable once the destination month crosses the boundary.2. Rename
overflowBehavior→outOfRangeBehavioroverflowBehaviordidn't convey that it bounds the view, not selection. Renamed for discoverability (no users yet, so the break is cheap):overflowBehavioroutOfRangeBehaviorOverflowBehaviorOutOfRangeBehaviorMonthOverflowBehaviorMonthOutOfRangeBehaviorAccepted values are unchanged (
"unbounded" \| "stop" \| "stop-shrink" \| "snap" \| "snap-shrink"). Internal helpers (overflow.ts,applyOverflow,canShift) keep their names — they describe the windowing mechanism, not the public knob.TSDoc on the prop and both types is expanded to spell out the view-vs-selection distinction, each value, and the precise condition under which
snapandsnap-shrinkdiverge.Scope
Library source + types + tests, the generated
formats/*subpath re-exports (regenerated), and the docs-site consumers (demo page + styled examples).Note
BREAKING. Major version bump via semantic-release.
Verification
vp fmtclean ·vp lint0/0attwclean (no 💀)🤖 Generated with Claude Code