-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update animations functionality to only support the native popover approach #970
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
52eadb2
Change how popover animations work and update docs
cwoolum 84b74db
fix: modal route not working + naming
maiieul 1a33205
fix: modal route not working + naming #2
maiieul 2a2e490
fix: p code style
maiieul 91feea3
chore: remove unnecessary import
maiieul 3ea0620
refactor: make compatibility note easier to maintain
maiieul 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
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,5 @@ | ||
--- | ||
'@qwik-ui/headless': minor | ||
--- | ||
|
||
We are removing the existing popover animations shimming and instead wil now only support native popover animations. This is considered a breaking change but will be more reliable overall. |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules | |
dist | ||
coverage | ||
.eslintrc.* | ||
vite.config.ts | ||
vite.config.ts | ||
packages/kit-headless/browsers/** |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test NodeJS ${{ matrix.node_version }} | ||
|
||
strategy: | ||
matrix: | ||
|
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,49 @@ | ||
import { component$ } from '@builder.io/qwik'; | ||
import { Note, NoteStatus } from '../note/note'; // Adjust the import path based on your structure | ||
|
||
export const TopLayerAnimationsCaveats = component$(() => { | ||
return ( | ||
<Note status={NoteStatus.Warning}> | ||
<strong>Important Caveats for Animating Discrete Properties</strong> | ||
|
||
<ul class="mt-4 list-disc bg-gradient-to-b pl-4"> | ||
<li> | ||
<strong> | ||
Animating <code>display</code> and <code>overlay</code>: | ||
</strong> | ||
<p> | ||
The <code>display</code> property must be included in the transitions list to | ||
ensure the element remains visible throughout the animation. The value flips | ||
from <code>none</code> to <code>block</code> at 0% of the animation, ensuring | ||
visibility for the entire duration. The | ||
<code>overlay</code> ensures the element stays in the top layer until the | ||
animation completes. | ||
</p> | ||
</li> | ||
<li> | ||
<strong> | ||
Using <code>transition-behavior: allow-discrete</code>: | ||
</strong> | ||
<p> | ||
This property is essential when animating discrete properties like{' '} | ||
<code>display</code> and <code>overlay</code>, which are not typically | ||
animatable. It ensures smooth transitions for these discrete properties. | ||
</p> | ||
</li> | ||
<li> | ||
<strong> | ||
Setting Starting Styles with <code>@starting-style</code>: | ||
</strong> | ||
<p> | ||
CSS transitions are only triggered when a property changes on a visible | ||
element. The | ||
<code>@starting-style</code> at-rule allows you to set initial styles (e.g.,{' '} | ||
<code>opacity</code> and | ||
<code>transform</code>) when the element first appears, ensuring that the | ||
animation behaves predictably. | ||
</p> | ||
</li> | ||
</ul> | ||
</Note> | ||
); | ||
}); |
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,22 @@ | ||
import { component$ } from '@builder.io/qwik'; | ||
import { Note, NoteStatus } from '../note/note'; // Adjust the import path based on your structure | ||
|
||
export const BrowserAnimationsCompatability = component$(() => { | ||
return ( | ||
<Note status={NoteStatus.Info}> | ||
<div class="flex flex-col gap-2"> | ||
<h4> | ||
<strong>Browser Compatability</strong> | ||
</h4> | ||
<p> | ||
<a href="https://caniuse.com/?search=popover%20API"> | ||
Browser versions that do not support the popover API natively | ||
</a>{' '} | ||
have known issues when trying to use animations or transitions. If you need to | ||
support legacy versions of browsers, please be sure to test this functionality | ||
independently. | ||
</p> | ||
</div> | ||
</Note> | ||
); | ||
}); |
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
32 changes: 30 additions & 2 deletions
32
apps/website/src/routes/docs/headless/modal/examples/animatable.tsx
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
42 changes: 42 additions & 0 deletions
42
apps/website/src/routes/docs/headless/modal/examples/backdrop-animatable.tsx
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,42 @@ | ||
import { component$, useStyles$ } from '@builder.io/qwik'; | ||
import { Modal, Label } from '@qwik-ui/headless'; | ||
|
||
export default component$(() => { | ||
useStyles$(` | ||
.modal-animation[open]::backdrop { | ||
animation: backdropFadeIn 0.75s ease-in-out forwards; | ||
} | ||
|
||
@keyframes backdropFadeIn { | ||
from { | ||
background-color: rgba(0, 0, 0, 0); | ||
} | ||
to { | ||
background-color: rgba(0, 0, 0, 0.65); | ||
} | ||
}`); | ||
|
||
return ( | ||
<Modal.Root> | ||
<Modal.Trigger class="modal-trigger">Open Modal</Modal.Trigger> | ||
<Modal.Panel class="modal-panel modal-animation"> | ||
<Modal.Title>Edit Profile</Modal.Title> | ||
<Modal.Description> | ||
You can update your profile here. Hit the save button when finished. | ||
</Modal.Description> | ||
<Label> | ||
Name | ||
<input type="text" placeholder="John Doe" /> | ||
</Label> | ||
<Label> | ||
<input type="text" placeholder="[email protected]" /> | ||
</Label> | ||
<footer> | ||
<Modal.Close class="modal-close">Cancel</Modal.Close> | ||
<Modal.Close class="modal-close">Save Changes</Modal.Close> | ||
</footer> | ||
</Modal.Panel> | ||
</Modal.Root> | ||
); | ||
}); |
25 changes: 23 additions & 2 deletions
25
apps/website/src/routes/docs/headless/modal/examples/transition.tsx
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
25 changes: 25 additions & 0 deletions
25
apps/website/src/routes/docs/headless/popover/auto-api/api.ts
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,25 @@ | ||
export const api = { | ||
popover: [ | ||
{ | ||
floating: [], | ||
}, | ||
{ | ||
'popover-panel-arrow': [], | ||
}, | ||
{ | ||
'popover-panel-impl': [], | ||
}, | ||
{ | ||
'popover-panel': [], | ||
}, | ||
{ | ||
'popover-root': [], | ||
}, | ||
{ | ||
'popover-trigger': [], | ||
}, | ||
{ | ||
'use-popover': [], | ||
}, | ||
], | ||
}; |
36 changes: 35 additions & 1 deletion
36
apps/website/src/routes/docs/headless/popover/examples/animation.tsx
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
32 changes: 31 additions & 1 deletion
32
apps/website/src/routes/docs/headless/popover/examples/transition.tsx
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.
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.
Adding this to make the actions page a bit more readable.