themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.82k stars 406 forks source link

feat(tooltip): adds tooltip support for restMs and delay properties #1200

Open DavidSeptimus-Klotho opened 7 months ago

DavidSeptimus-Klotho commented 7 months ago

implements #589

This change adds support for floating-ui's useHover restMs and delay props to the Tooltip component to enable delayed opening/closing of tooltips.

vercel[bot] commented 7 months ago

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

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2024 0:49am
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7461173) 99.54% compared to head (76132ab) 97.37%. Report is 186 commits behind head on main.

:exclamation: Current head 76132ab differs from pull request most recent head b379544. Consider uploading reports for the commit b379544 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1200 +/- ## ========================================== - Coverage 99.54% 97.37% -2.18% ========================================== Files 163 214 +51 Lines 6621 9093 +2472 Branches 401 530 +129 ========================================== + Hits 6591 8854 +2263 - Misses 30 239 +209 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tulup-conner commented 7 months ago

I understand the practical appeal, but this functionality isn't available in the upstream library at flowbite.com, so I'm not sure if we should add it here.

@zoltanszogyenyi I defer to you on this one - it seems like this would be a useful feature, and it's also pretty difficult to create a wrapper of our component to achieve this. You would probably be forced to patch flowbite-react to do so.

DavidSeptimus-Klotho commented 7 months ago

It looks like the upstream has support for trigger="none" and exposes show(), hide(), and toggle() functions for custom triggers. It just seems kind of wasteful to have to reimplement delay when it's supported by the underlying floating-ui implementation.

SutuSebastian commented 2 months ago

Nice one! It only needs re-build since we now have new monorepo structure (see #1264).

If u feel like u don't have the time, I can take it from here, just let me know! 🤝

DavidSeptimus-Klotho commented 1 week ago

@SutuSebastian I doubt I'll have time for this in the near-term. Feel free to pick it up if you'd like.