instacart / Snacks

The Instacart Component Library
https://instacart.github.io/Snacks/
Apache License 2.0
81 stars 36 forks source link

tooltip: extend props to support backgroundColor #420

Closed j4p3 closed 4 years ago

j4p3 commented 4 years ago

This PR extends Tooltip to accept backgroundColor style.

Use case:

https://instacart.quip.com/n7AzALPs30F7/PRD-Tooltips-1st-Journey-Education

The rest of the functionality described in the PRD can be accomplished with child components of the Tooltip.

An alternative approach would be to create a new snacksStyle preset to match whichever direction the onboarding tooltip design goes in the future. This seems like overkill for now, but is worth considering.

codecov[bot] commented 4 years ago

Codecov Report

Merging #420 into master will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #420   +/-   ##
=======================================
  Coverage   83.84%   83.84%           
=======================================
  Files          62       62           
  Lines        1300     1300           
  Branches      230      230           
=======================================
  Hits         1090     1090           
  Misses        159      159           
  Partials       51       51           
j4p3 commented 4 years ago

👇 Codeclimate is correct about duplication, but there doesn't seem to be much we can do about it. Extracting PropTypes to their own object seems like a solution better suited to typescript.