Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(popup): now watching anchor size for position correctness (#1236)
* fix(popup): now watching anchor size for position correctness Closes #1234 * Linting fixes * update story * Fix the tests * Fix linting * Refactor tests Co-authored-by: Rina <rina.oksman@vonage.com>
- Loading branch information
1 parent
f05114d
commit 755c072
Showing
7 changed files
with
137 additions
and
24 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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,45 @@ | ||
import '@vonage/vwc-popup'; | ||
import '@vonage/vwc-button'; | ||
import '@vonage/vwc-text'; | ||
|
||
export async function createElementVariations(wrapper) { | ||
const textElementWrapper = document.createElement('div'); | ||
textElementWrapper.innerHTML = ` | ||
<style> | ||
.popup-wrapper { | ||
width: 100%; | ||
height: 400px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: var(--vvd-color-neutral-10); | ||
} | ||
.content { | ||
width: 200px; | ||
text-align: left; | ||
padding: 1rem; | ||
} | ||
.line { | ||
border-bottom: 1px solid var(--vvd-color-neutral-40); | ||
padding-bottom: 0.5rem; | ||
margin-bottom: 0.5rem; | ||
} | ||
</style> | ||
<div class="popup-wrapper"> | ||
<vwc-button id="buttonAnchor" layout="outlined" outlined aria-haspopup="true" aria-describedby="popup">Click to open popup</vwc-button> | ||
<vwc-popup id="popup" open corner="left" dismissible anchor="buttonAnchor"> | ||
<div class="content"> | ||
<vwc-text font-face="body-1-bold" tight><p class="line">Popup title</p></vwc-text> | ||
<vwc-text font-face="body-2" tight>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</vwc-text> | ||
</div> | ||
</vwc-popup> | ||
<vwc-popup arrow alternate corner="right" id="popup" open anchor="buttonAnchor"> | ||
<div class="content"> | ||
<vwc-text font-face="body-1-bold" tight><p class="line">Popup title</p></vwc-text> | ||
<vwc-text font-face="body-2" tight>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</vwc-text> | ||
</div> | ||
</vwc-popup> | ||
</div>`; | ||
wrapper.appendChild(textElementWrapper); | ||
|
||
} |