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

New <Tooltip /> component 🧪 #164

Merged
merged 1 commit into from
Jan 14, 2020
Merged

Conversation

ubbe-xyz
Copy link
Contributor

Summary

New <Tooltip /> component which in turns is just a wrapper over @tippy.js/react with design constraints applied on top.

Bundle cost

Tippy JS handles already a lot of the edge-cases associated to tooltips for us ( 👀 "Adaptability" section below ) and make sure they stay as accessible as possible.

This comes with an import cost though ☝🏻 ( what do you think @poteirard ? ) but at least we think is safer and more performant than any custom solution we could engineer...

Adaptability

1. Hover

2. Touch

3. Fit on scroll

(  👀 notice how the tooltip vertical alignment changes... )

4. Fit on viewport edge

(  👀 notice how the tooltip horizontal alignment changes... )

New <Tooltip /> component which in turn is just a wrapper over `@tippy.js/react` with some styling constraints applied.
@codecov
Copy link

codecov bot commented Jan 14, 2020

Codecov Report

Merging #164 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
+ Coverage   92.35%   92.38%   +0.02%     
==========================================
  Files          69       70       +1     
  Lines         628      630       +2     
  Branches      166      166              
==========================================
+ Hits          580      582       +2     
  Misses         48       48
Impacted Files Coverage Δ
src/components/molecules/Tooltip/Tooltip.tsx 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 428cc77...8601c09. Read the comment docs.

import { render } from '@testing-library/react';
import Tooltip from './Tooltip';

describe('<Tooltip />', () => {
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 didn't think necessary to add more tests, given we're just wrapping a library that is quite well tested already 👍🏻

@ubbe-xyz ubbe-xyz merged commit acc84a6 into master Jan 14, 2020
@ubbe-xyz ubbe-xyz deleted the feat/162-tooltip-molecule branch January 14, 2020 16:50
@poteirard
Copy link
Contributor

🎉 This PR is included in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants