-
Notifications
You must be signed in to change notification settings - Fork 794
feat(OverlayProvider): support stacking #4360
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
Open
Barbapapazes
wants to merge
7
commits into
nuxt:v3
Choose a base branch
from
Barbapapazes:feat/support-overlay-stacking
base: v3
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
7 commits
Select commit
Hold shift + click to select a range
180f93f
feat(Overlay): support stacking
Barbapapazes 117b1fe
chore: fix imports
Barbapapazes 08ebb49
Update playground/app/app.config.ts
Barbapapazes 48ee64e
docs(OverlayProvider): stack modal example
Barbapapazes fd53211
refactor: use overlay-provider theme
Barbapapazes 82e615f
chore: format
Barbapapazes 61bd2b8
Merge branch 'v3' into feat/support-overlay-stacking
benjamincanac 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 hidden or 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 hidden or 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
17 changes: 17 additions & 0 deletions
17
docs/app/components/content/examples/modal/ModalStackingExample.vue
This file contains hidden or 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,17 @@ | ||
<script lang="ts" setup> | ||
import { LazyStackingModal } from '#components' | ||
|
||
const overlay = useOverlay() | ||
|
||
function onClick() { | ||
overlay | ||
.create(LazyStackingModal, { | ||
destroyOnClose: true | ||
}) | ||
.open() | ||
} | ||
</script> | ||
|
||
<template> | ||
<UButton label="Open" variant="subtle" color="neutral" @click="onClick" /> | ||
</template> |
24 changes: 24 additions & 0 deletions
24
docs/app/components/content/examples/modal/StackingModal.vue
This file contains hidden or 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,24 @@ | ||
<script lang="ts" setup> | ||
// eslint-disable-next-line import/no-self-import | ||
import StackingModal from './StackingModal.vue' | ||
benjamincanac marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const overlay = useOverlay() | ||
function onClick() { | ||
overlay | ||
.create(StackingModal, { | ||
destroyOnClose: true | ||
}) | ||
.open() | ||
} | ||
</script> | ||
|
||
<template> | ||
<UModal | ||
title="A Modal" | ||
:ui="{ footer: 'justify-end', content: 'data-[state=open]:animate-[light-slide-in-from-bottom_200ms_ease-out] data-[state=closed]:animate-[light-slide-out-to-bottom_200ms_ease-in]' }" | ||
> | ||
<template #footer> | ||
<UButton label="Another Modal" variant="subtle" color="neutral" @click="onClick" /> | ||
</template> | ||
</UModal> | ||
</template> |
This file contains hidden or 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 hidden or 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 hidden or 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,21 @@ | ||
<script lang="ts" setup> | ||
import SecondModal from './SecondModal.vue' | ||
|
||
const emit = defineEmits(['close']) | ||
|
||
const overlay = useOverlay() | ||
function openSecondModal() { | ||
overlay.create(SecondModal, { | ||
destroyOnClose: true | ||
}).open() | ||
} | ||
</script> | ||
|
||
<template> | ||
<UModal title="First modal" description="This is the first modal opened from the button."> | ||
<template #footer> | ||
<UButton label="Open second modal" color="neutral" variant="outline" @click="openSecondModal" /> | ||
<UButton color="neutral" label="Close" @click="emit('close')" /> | ||
</template> | ||
</UModal> | ||
</template> |
This file contains hidden or 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,11 @@ | ||
<script setup lang="ts"> | ||
const emit = defineEmits(['close']) | ||
</script> | ||
|
||
<template> | ||
<UModal title="Second modal" description="This is the second modal opened from the button."> | ||
<template #footer> | ||
<UButton color="neutral" label="Close" @click="emit('close')" /> | ||
</template> | ||
</UModal> | ||
</template> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
export default { | ||
slots: { | ||
base: '' | ||
}, | ||
variants: { | ||
stacked: { | ||
true: { | ||
base: 'origin-top transition-transform duration-200 [--overlay-value:calc(var(--overlay-count)-var(--overlay-index)-1)] scale-[calc(1-0.05*var(--overlay-value))] transform-[translateY(calc(-1.25rem*var(--overlay-value)))]' | ||
} | ||
} | ||
} | ||
} |
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.
What happens by default if we don't specify these? Just an idea but maybe we could add a
stacked
prop to the UModal component as well to use those animations (which would be defined insidekeyframe.css
)?Uh oh!
There was an error while loading. Please reload this page.
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.
by default, it uses the animation
scale-in
which does not looks really great. but I agree that we can add a new props to modal with a new animation (that looks better in that specific case).