Merged
Conversation
Owner
gfazioli
commented
Jan 30, 2026
- 🔧 chore(deps): Update core dependencies to latest patch releases
- 🚀 feat(Compare): add min/max drag boundary props and clamp logic
- feat(Compare): add min/max drag bound props
- bump next, react, react-dom to 15.5.11 / 19.2.4 - update @next/mdx, rollup, typescript-eslint, @types/react - ensures compatibility with latest tooling and addresses security fixes
- Introduce `minDragBound` and `maxDragBound` props with defaults 0 and 100. - Clamp drag coordinates to container bounds to prevent handle jumping. - Apply boundaries to calculated position, keeping slider within specified limits.
- Introduce `minDragBound` and `maxDragBound` to limit slider movement range. - Add a new dragBounds demo and documentation section explaining usage. - Update story controls to expose the new props.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates core dependencies and enhances the Compare component’s drag behavior, especially for diagonal angles. It introduces configurable drag boundaries and improves pointer clamping so the handle behaves correctly within the container.
Changes:
- Bumped React, Next, Rollup, TypeScript ESLint, and related type packages to newer patch versions in
package.json,docs/package.json, andyarn.lock. - Added
minDragBoundandmaxDragBoundprops toCompare, with default values, state wiring, and geometry updates so drag interactions are clamped to a configurable percentage range. - Updated Storybook stories and docs site: added configurator controls for the new props, a dedicated “Drag boundaries” demo, and documentation describing how to use the new bounds.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Aligns lockfile with updated React, Next, Rollup, TypeScript ESLint, and related tooling and type versions referenced in package.json and docs/package.json. |
| package/src/CompareProps.story.tsx | Extends the props Storybook story to expose minDragBound and maxDragBound with numeric controls and default values matching the component. |
| package/src/Compare.tsx | Adds minDragBound/maxDragBound props and default values, clamps pointer coordinates to the container, and constrains computed slider position within the configured bounds while preserving diagonal angle behavior. |
| package.json | Bumps React, React DOM, Rollup, TypeScript ESLint, and @types/react to newer patch versions for the main package. |
| docs/package.json | Bumps Next, React, React DOM, @next/mdx, and @types/react to corresponding newer patch versions for the docs app. |
| docs/docs.mdx | Documents the new drag boundary props, explaining their semantics and adding a demo section wired to the new dragBounds demo. |
| docs/demos/index.ts | Re-exports the new dragBounds demo so it can be used in the docs. |
| docs/demos/Compare.demo.dragBounds.tsx | Introduces a standalone demo showcasing minDragBound/maxDragBound on a diagonal (angle={30}) compare, with matching code snippet for docs. |
| docs/demos/Compare.demo.configurator.tsx | Extends the configurator controls to include minDragBound and maxDragBound, allowing interactive exploration of drag boundaries. |
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.