-
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.
fixes: #70
- Loading branch information
Showing
7 changed files
with
120 additions
and
17 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
100 changes: 100 additions & 0 deletions
100
packages/core/src/components/modal/tests/basic/index.html
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,100 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Dropdown | Poppy-ui</title> | ||
<link rel="stylesheet" href="/dist/poppy/poppy.css"> | ||
<script type="module" src="/dist/poppy/poppy.esm.js"></script> | ||
<script nomodule src="/dist/poppy/poppy.js"></script> | ||
<style> | ||
main { | ||
width: 100vw; | ||
height: 100dvh; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
padding: 1rem; | ||
|
||
background-color: var(--base-300); | ||
} | ||
|
||
section { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: .35rem; | ||
} | ||
|
||
div { | ||
display: flex; | ||
justify-content: center; | ||
gap: .5rem; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<main> | ||
<section> | ||
<h2>Dropdown - basic</h2> | ||
<div> | ||
<pop-button id="default-btn">default</pop-button> | ||
<pop-modal id="default" trigger="default-btn"> | ||
basic | ||
<pop-button slot="actions" class="close">close</pop-button> | ||
</pop-modal> | ||
</div> | ||
</section> | ||
<section> | ||
<h2>Dropdown - Show backdrop</h2> | ||
<div> | ||
<pop-button id="show-backdrop-btn">show-backdrop</pop-button> | ||
<pop-modal id="show-backdrop" trigger="show-backdrop-btn" show-backdrop> | ||
show backdrop | ||
<pop-button slot="actions" class="close">close</pop-button> | ||
</pop-modal> | ||
</div> | ||
</section> | ||
<section> | ||
<h2>Dropdown - Backdrop</h2> | ||
<div> | ||
<pop-button id="backdrop-dismiss-btn">backdrop-dismiss</pop-button> | ||
<pop-modal id="backdrop-dismiss" trigger="backdrop-dismiss-btn" backdrop-dismiss> | ||
backdrop dismiss | ||
<pop-button slot="actions" class="close">close</pop-button> | ||
</pop-modal> | ||
</div> | ||
</section> | ||
<section> | ||
<h2>Dropdown - Open</h2> | ||
<div> | ||
<pop-button id="open-btn">open</pop-button> | ||
<pop-modal id="open" trigger="open-btn" open> | ||
Open by default | ||
<pop-button slot="actions" class="close">close</pop-button> | ||
</pop-modal> | ||
</div> | ||
</section> | ||
</main> | ||
|
||
<script> | ||
document.querySelectorAll('.close').forEach(btn => { | ||
btn.addEventListener('click', () => { | ||
btn.parentElement.dismiss(); | ||
}); | ||
}); | ||
|
||
document.querySelectorAll('pop-modal').forEach(modal => { | ||
modal.addEventListener('present', () => { | ||
console.log('present', modal.id) | ||
}); | ||
modal.addEventListener('dismiss', () => { | ||
console.log('dismiss', modal.id) | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
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