Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Popover UI primitive #1849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cpcramer
Copy link
Contributor

@cpcramer cpcramer commented Jan 22, 2025

What changed? Why?
Add Popover UI Primitive.

This primitive handles positioning relative to an anchor / trigger element, focus management, click outside and escape key dismissal, portal rendering, and proper ARIA attributes.

Notes to reviewers

How has it been tested?
Tested with SwapSettings component - PR implementation to follow.

Tested updates to DismissableLayer, WalletModal still works as expected.

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:57pm
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:57pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:57pm

/**
* Calculates the initial position of the popover based on the position prop.
*/
function getInitialPosition(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see these functions being reused so i've left them in the Popover file

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

Successfully merging this pull request may close these issues.

1 participant