-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Install react-tooltip * Add new Tooltipo component * Update Tooltip stories * Add a global css object for tests * Replace legacy tooltip with new one * Use spans as tooltip anchor wrapper * Replace react-tooltip with rc-tooltip Co-authored-by: Alessio Biancalana <alessio.biancalana@suse.com> * Switch Tooltip implementation to rc-tooltip Co-authored-by: Alessio Biancalana <alessio.biancalana@suse.com> --------- Co-authored-by: Alessio Biancalana <alessio.biancalana@suse.com>
- Loading branch information
1 parent
d2c9682
commit c9a1a6f
Showing
13 changed files
with
480 additions
and
110 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
/** | ||
Style retrieved here https://stackblitz.com/edit/vitejs-vite-drjjx5?file=src%2Fassets%2Fstyles%2Frc-tooltip.scss | ||
as mentioned in issue https://github.com/react-component/tooltip/issues/445 | ||
*/ | ||
.rc-tooltip-fade-enter, | ||
.rc-tooltip-fade-leave { | ||
display: block; | ||
} | ||
.rc-tooltip.rc-tooltip-fade-enter, | ||
.rc-tooltip.rc-tooltip-fade-appear { | ||
opacity: 0; | ||
animation-duration: 0.2s; | ||
animation-play-state: paused; | ||
animation-timing-function: linear; | ||
animation-fill-mode: both; | ||
} | ||
.rc-tooltip.rc-tooltip-fade-leave { | ||
animation-duration: 0.2s; | ||
animation-play-state: paused; | ||
animation-timing-function: linear; | ||
animation-fill-mode: both; | ||
} | ||
.rc-tooltip.rc-tooltip-fade-enter.rc-tooltip-fade-enter-active, | ||
.rc-tooltip.rc-tooltip-fade-appear.rc-tooltip-fade-appear-active { | ||
animation-name: rcToolTipFadeIn; | ||
animation-play-state: running; | ||
} | ||
.rc-tooltip.rc-tooltip-fade-leave.rc-tooltip-fade-leave-active { | ||
animation-name: rcToolTipFadeOut; | ||
animation-play-state: running; | ||
} | ||
@keyframes rcToolTipFadeIn { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
@keyframes rcToolTipFadeOut { | ||
0% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
.rc-tooltip { | ||
/** | ||
max-width: 200px; | ||
font-size: 12px; | ||
line-height: 1.5; | ||
*/ | ||
@apply block absolute visible opacity-100; | ||
|
||
&.rc-tooltip.rc-tooltip-fade-enter, | ||
&.rc-tooltip.rc-tooltip-fade-appear { | ||
animation-duration: 0.2s; | ||
animation-play-state: paused; | ||
animation-timing-function: linear; | ||
animation-fill-mode: both; | ||
@apply opacity-0; | ||
} | ||
&.rc-tooltip.rc-tooltip-fade-leave { | ||
animation-duration: 0.2s; | ||
animation-play-state: paused; | ||
animation-timing-function: linear; | ||
animation-fill-mode: both; | ||
} | ||
&.rc-tooltip.rc-tooltip-fade-enter.rc-tooltip-fade-enter-active, | ||
&.rc-tooltip.rc-tooltip-fade-appear.rc-tooltip-fade-appear-active { | ||
animation-name: rcToolTipFadeIn; | ||
animation-play-state: running; | ||
} | ||
&.rc-tooltip.rc-tooltip-fade-leave.rc-tooltip-fade-leave-active { | ||
animation-name: rcToolTipFadeOut; | ||
animation-play-state: running; | ||
} | ||
} | ||
.rc-tooltip-hidden { | ||
@apply hidden; | ||
} | ||
.rc-tooltip-placement-top, | ||
.rc-tooltip-placement-topLeft, | ||
.rc-tooltip-placement-topRight { | ||
padding: 5px 0 5px 0; | ||
} | ||
.rc-tooltip-placement-right, | ||
.rc-tooltip-placement-rightTop, | ||
.rc-tooltip-placement-rightBottom { | ||
padding: 0 5px 0 5px; | ||
} | ||
.rc-tooltip-placement-bottom, | ||
.rc-tooltip-placement-bottomLeft, | ||
.rc-tooltip-placement-bottomRight { | ||
padding: 5px 0 5px 0; | ||
} | ||
.rc-tooltip-placement-left, | ||
.rc-tooltip-placement-leftTop, | ||
.rc-tooltip-placement-leftBottom { | ||
padding: 0 5px 0 5px; | ||
} | ||
|
||
/** | ||
.rc-tooltip-inner is not styled to allow customization from the | ||
.rc-tooltip-inner { | ||
min-height: 34px; | ||
padding: 8px 10px; | ||
border-radius: 6px; | ||
background-color: #373737; | ||
color: #fff; | ||
text-decoration: none; | ||
text-align: center; | ||
box-shadow: 0 0 4px rgba(0, 0, 0, 0.17); | ||
} | ||
*/ | ||
.rc-tooltip-arrow { | ||
position: absolute; | ||
width: 0; | ||
height: 0; | ||
border-style: solid; | ||
border-color: transparent; | ||
} | ||
.rc-tooltip-placement-top .rc-tooltip-arrow, | ||
.rc-tooltip-placement-topLeft .rc-tooltip-arrow, | ||
.rc-tooltip-placement-topRight .rc-tooltip-arrow { | ||
bottom: 0; | ||
margin-left: -5px; | ||
border-width: 5px 5px 0; | ||
border-top-color: #373737; | ||
} | ||
.rc-tooltip-placement-top .rc-tooltip-arrow { | ||
left: 50%; | ||
} | ||
.rc-tooltip-placement-topLeft .rc-tooltip-arrow { | ||
left: 15%; | ||
} | ||
.rc-tooltip-placement-topRight .rc-tooltip-arrow { | ||
right: 15%; | ||
} | ||
.rc-tooltip-placement-right .rc-tooltip-arrow, | ||
.rc-tooltip-placement-rightTop .rc-tooltip-arrow, | ||
.rc-tooltip-placement-rightBottom .rc-tooltip-arrow { | ||
left: 4px; | ||
margin-top: -5px; | ||
border-width: 5px 5px 5px 0; | ||
border-right-color: #373737; | ||
} | ||
.rc-tooltip-placement-right .rc-tooltip-arrow { | ||
top: 50%; | ||
} | ||
.rc-tooltip-placement-rightTop .rc-tooltip-arrow { | ||
top: 15%; | ||
margin-top: 0; | ||
} | ||
.rc-tooltip-placement-rightBottom .rc-tooltip-arrow { | ||
bottom: 15%; | ||
} | ||
.rc-tooltip-placement-left .rc-tooltip-arrow, | ||
.rc-tooltip-placement-leftTop .rc-tooltip-arrow, | ||
.rc-tooltip-placement-leftBottom .rc-tooltip-arrow { | ||
right: 4px; | ||
margin-top: -5px; | ||
border-width: 5px 0 5px 5px; | ||
border-left-color: #373737; | ||
} | ||
.rc-tooltip-placement-left .rc-tooltip-arrow { | ||
top: 50%; | ||
} | ||
.rc-tooltip-placement-leftTop .rc-tooltip-arrow { | ||
top: 15%; | ||
margin-top: 0; | ||
} | ||
.rc-tooltip-placement-leftBottom .rc-tooltip-arrow { | ||
bottom: 15%; | ||
} | ||
.rc-tooltip-placement-bottom .rc-tooltip-arrow, | ||
.rc-tooltip-placement-bottomLeft .rc-tooltip-arrow, | ||
.rc-tooltip-placement-bottomRight .rc-tooltip-arrow { | ||
top: 4px; | ||
margin-left: -5px; | ||
border-width: 0 5px 5px; | ||
border-bottom-color: #373737; | ||
} | ||
.rc-tooltip-placement-bottom .rc-tooltip-arrow { | ||
left: 50%; | ||
} | ||
.rc-tooltip-placement-bottomLeft .rc-tooltip-arrow { | ||
left: 15%; | ||
} | ||
.rc-tooltip-placement-bottomRight .rc-tooltip-arrow { | ||
right: 15%; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.