-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tooltip support for radio fields
The new single page form has 50% width radio fields. This breaks the display of the help text so they now can be moved into tooltips when needed. Ticket: https://phabricator.wikimedia.org/T373520
- Loading branch information
Showing
6 changed files
with
128 additions
and
16 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
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,78 @@ | ||
<template> | ||
<span class="radio-field-tooltip"> | ||
<InfoIcon/> | ||
<span :id="textId" class="radio-field-tooltip-text"> | ||
<slot/> | ||
</span> | ||
<span class="is-sr-only"><slot/></span> | ||
</span> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import InfoIcon from '@src/components/shared/icons/InfoIcon.vue'; | ||
interface Props { | ||
textId?: string; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use '@src/scss/settings/colors'; | ||
.radio-field-tooltip { | ||
position: absolute; | ||
display: block; | ||
right: 10px; | ||
top: 50%; | ||
margin-top: -8px; | ||
height: 16px; | ||
width: 17px; | ||
&-text { | ||
position: absolute; | ||
display: block; | ||
visibility: hidden; | ||
opacity: 0; | ||
height: 60px; | ||
width: 280px; | ||
top: -70px; | ||
right: -8px; | ||
background: colors.$white; | ||
padding: 10px; | ||
border: 1px solid colors.$gray-dark; | ||
border-radius: 2px; | ||
color: rgba(0, 0, 0, .6); | ||
box-shadow: 0 0 4px rgb( 0 0 0 / 10% ); | ||
transition: visibility 200ms, opacity 200ms ease-in-out; | ||
&:before { | ||
content: ''; | ||
position: absolute; | ||
bottom: -9px; | ||
right: 6px; | ||
width: 0; | ||
height: 0; | ||
border-style: solid; | ||
border-width: 9px 10px 0 9px; | ||
border-color: colors.$gray-mid transparent transparent transparent; | ||
} | ||
&:after { | ||
content: ''; | ||
position: absolute; | ||
bottom: -7px; | ||
right: 8px; | ||
width: 0; | ||
height: 0; | ||
border-style: solid; | ||
border-width: 8px 8px 0 8px; | ||
border-color: colors.$white transparent transparent transparent; | ||
} | ||
} | ||
} | ||
</style> |
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