-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(popover-beta): Added popover-beta component #642
Open
jason-evans-genesys
wants to merge
11
commits into
main
Choose a base branch
from
feature/COMUI-1637-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f34bb69
feat(popover-beta): Added popover-beta component that uses the native…
jason-evans-genesys b9aa75e
chore(popover-beta): PR feedback
jason-evans-genesys ac36a96
chore(popover-beta): Using togglePopover method
jason-evans-genesys df4f6d9
chore(popover-beta): More PR feedback
jason-evans-genesys e8cac12
chore(popover-beta): Fixed positioning issue of popover
jason-evans-genesys 96eb1b9
chore(popover-beta): Fixed tests
jason-evans-genesys 5d7a009
chore(popover-beta): Snapshot test update
jason-evans-genesys c8ef7eb
chore(popover-beta): Fixed snapshot
jason-evans-genesys 090b604
chore(popover-beta): Using floating-ui hide
jason-evans-genesys f85b0b3
chore(popover-beta): Merged main into branch
jason-evans-genesys fa5c7ea
chore(popover-beta): Fixed tests
jason-evans-genesys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
packages/genesys-spark-components/src/components/beta/gux-popover-beta/example.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,69 @@ | ||
<h1>gux-popover</h1> | ||
<div class="scroll-container"> | ||
<div class="scroll-interior"> | ||
<gux-button id="popover-target">Example Element</gux-button> | ||
<gux-popover-beta | ||
id="popover-example" | ||
position="top" | ||
for="popover-target" | ||
is-open | ||
display-dismiss-button | ||
> | ||
<span slot="title">Title</span> | ||
<div class="popover-content-wrapper"> | ||
<div>Popover Content</div> | ||
<gux-cta-group align="end"> | ||
<gux-button slot="primary" onclick="notify(event)" | ||
>Action 3</gux-button | ||
> | ||
<gux-button slot="secondary" onclick="notify(event)" | ||
>Action 2</gux-button | ||
> | ||
<gux-button slot="dismiss" onclick="notify(event)" | ||
>Action 1</gux-button | ||
> | ||
</gux-cta-group> | ||
</div> | ||
</gux-popover-beta> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.scroll-container { | ||
width: 900px; | ||
height: 300px; | ||
margin: auto; | ||
overflow: scroll; | ||
border: 1px solid #aaa; | ||
} | ||
|
||
.scroll-interior { | ||
position: relative; | ||
width: 600px; | ||
height: 600px; | ||
background-color: #fff; | ||
} | ||
|
||
.popover-content-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
} | ||
|
||
.popover-content { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 8px; | ||
width: 280px; | ||
} | ||
|
||
#popover-target { | ||
position: absolute; | ||
left: 250px; | ||
display: inline-block; | ||
padding: 10px 15px; | ||
background-color: #fdfdfd; | ||
border: 1px #e4e9f0; | ||
box-shadow: 0 0 2px fade(#202937, 24%); | ||
} | ||
</style> |
71 changes: 71 additions & 0 deletions
71
packages/genesys-spark-components/src/components/beta/gux-popover-beta/gux-popover.scss
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,71 @@ | ||
/* This is necessary to override the position of the popover on the page. By default, an HTML popover will | ||
render in the middle of the screen, which we do not want */ | ||
:popover-open { | ||
position: absolute; | ||
inset: unset; | ||
} | ||
|
||
.gux-popover-wrapper { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: var( | ||
--gse-semantic-zIndex-popover | ||
); // TODO: this will not work because the popover will display in the top layer. Figure out a solution. | ||
|
||
min-width: 280px; // TODO: add new token once UX has added it: GDS-2672 | ||
padding: var(--gse-ui-popover-gap); | ||
overflow: hidden; | ||
background-color: var(--gse-ui-popover-backgroundColor); | ||
border: none; | ||
border-radius: var(--gse-ui-popover-borderRadius); | ||
box-shadow: var( | ||
--gse-ui-popover-boxShadow-x, | ||
--gse-ui-popover-boxShadow-offsetX | ||
) | ||
var(--gse-ui-popover-boxShadow-y, --gse-ui-popover-boxShadow-offsetY) | ||
var(--gse-ui-popover-boxShadow-blur) var(--gse-ui-popover-boxShadow-spread) | ||
var(--gse-ui-tooltip-boxShadow-color); | ||
|
||
.gux-arrow { | ||
position: absolute; | ||
width: var(--gse-ui-popover-anchor-width); | ||
height: var(--gse-ui-popover-anchor-height); | ||
|
||
/* 4px padding leaves some space for the shadow to bleed into */ | ||
padding-bottom: 4px; | ||
overflow: hidden; | ||
} | ||
|
||
.gux-arrow-caret { | ||
width: 0; | ||
height: 0; | ||
filter: drop-shadow( | ||
var(--gse-ui-popover-boxShadow-x, --gse-ui-popover-boxShadow-offsetX) | ||
var(--gse-ui-popover-boxShadow-y, --gse-ui-popover-boxShadow-offsetY) | ||
calc(var(--gse-ui-popover-boxShadow-blur) / 2) | ||
var(--gse-ui-tooltip-boxShadow-color) | ||
); | ||
border-top: calc(var(--gse-ui-popover-anchor-width) / 2) solid | ||
var(--gse-ui-popover-backgroundColor); | ||
border-right: calc(var(--gse-ui-popover-anchor-width) / 2) solid transparent; | ||
border-left: calc(var(--gse-ui-popover-anchor-width) / 2) solid transparent; | ||
} | ||
|
||
.gux-popover-header { | ||
display: flex; | ||
flex-direction: row; | ||
place-content: center space-between; | ||
align-items: center; | ||
padding-bottom: var(--gse-ui-popover-gap); | ||
font-family: var(--gse-ui-popover-title-text-fontFamily); | ||
font-size: var(--gse-ui-popover-title-text-fontSize); | ||
font-weight: var(--gse-ui-popover-title-text-fontWeight); | ||
line-height: var(--gse-ui-popover-title-text-lineHeight); | ||
color: var(--gse-ui-popover-headerColor); | ||
} | ||
|
||
gux-dismiss-button { | ||
float: right; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this arrow is currently displaying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into this now.