feat: add tooltip core - #212
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds tooltip functionality to the core library and integrates collision detection logic into the popover system. The tooltip component extends the existing popover implementation with tooltip-specific defaults (hover-only behavior) while leveraging the new collision detection capabilities.
Key changes:
- Moved math utilities (Point interface, line projection, distance) from slider component to shared utils for reuse
- Added collision detection to popover core that calculates boundary adjustments and positioning constraints
- Created tooltip component as a wrapper around popover with tooltip-specific defaults
- Updated React and HTML implementations to use the new core components
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utils/src/shared/string.ts | Added toKebabCase utility function for converting camelCase to kebab-case |
| packages/utils/src/shared/math.ts | Moved Point interface and geometric calculation utilities from slider to shared utils |
| packages/utils/src/index.ts | Exported new math utilities module |
| packages/utils/src/dom/element.ts | Added translate handling functions and renamed getBoundingClientRectWithoutTransform |
| packages/utils/src/dom/attributes.ts | Updated style property setter to use kebab-case conversion |
| packages/react/src/utils/use-mutation-observer.ts | Added React hook for observing DOM mutations |
| packages/react/src/components/Tooltip.tsx | Refactored to use core tooltip implementation with component factory pattern |
| packages/react/src/components/Popover.tsx | Updated to use computed popover styles from core state |
| packages/html/src/elements/volume-slider.ts | Fixed anchor-name style property to use camelCase |
| packages/html/src/elements/tooltip.ts | Refactored to use core tooltip implementation |
| packages/html/src/elements/time-slider.ts | Fixed anchor-name style property to use camelCase |
| packages/html/src/elements/popover.ts | Updated to use computed popover styles from core state |
| packages/core/src/index.ts | Exported new Tooltip component and state |
| packages/core/src/components/tooltip.ts | Added core tooltip component extending popover |
| packages/core/src/components/slider.ts | Removed geometric utilities (moved to shared utils) |
| packages/core/src/components/popover.ts | Added collision detection logic and cursor tracking support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
Merged
Merged
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.
Uh oh!
There was an error while loading. Please reload this page.