-
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.
feat: external navigation warning (#802)
* feat: external navigation warning * fix: apply only to metadata and non radix urls
- Loading branch information
1 parent
fc2d1be
commit 26dfadf
Showing
11 changed files
with
211 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script> | ||
import { fade } from 'svelte/transition' | ||
export let zIndex = 2 | ||
export let duration = 300 | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-click-events-have-key-events --> | ||
<div | ||
class="backdrop" | ||
transition:fade={{ duration }} | ||
on:click|self | ||
style:z-index={zIndex} | ||
/> | ||
|
||
<style> | ||
.backdrop { | ||
backdrop-filter: blur(8px); | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
background: rgba(0, 0, 0, 0.5); | ||
} | ||
</style> |
38 changes: 0 additions & 38 deletions
38
packages/ui/src/components/_base/dialog/Dialog.stories.svelte
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,50 +1,37 @@ | ||
<script lang="ts"> | ||
import { | ||
Dialog, | ||
DialogOverlay, | ||
DialogTitle, | ||
DialogDescription | ||
} from '@rgossiaux/svelte-headlessui' | ||
import { css } from '@styles' | ||
import Box from '@components/_base/box/Box.svelte' | ||
import type { config } from '@styles' | ||
import { fade, scale } from 'svelte/transition' | ||
import Backdrop from '../backdrop/Backdrop.svelte' | ||
export let size: | ||
| `$${(typeof config)['theme']['sizes']['4xl']}` | ||
| `$${(typeof config)['theme']['sizes']['5xl']}` | ||
| `$${(typeof config)['theme']['sizes']['6xl']}` | ||
export let open = true | ||
const overlay = css({ | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
backgroundColor: 'rgba(0, 0, 0, 0.5)', | ||
alpha: 0.5, | ||
width: '100%', | ||
height: '100%' | ||
})() | ||
export let open = false | ||
</script> | ||
|
||
<Dialog {open} on:close={() => (open = false)}> | ||
<DialogOverlay class={overlay} /> | ||
<Box | ||
cx={{ | ||
position: 'fixed', | ||
zIndex: 1000, | ||
top: '50%', | ||
left: '50%', | ||
transform: 'translate(-50%, -50%)', | ||
width: size, | ||
padding: '$sm', | ||
borderRadius: '$md' | ||
{#if open} | ||
<Backdrop zIndex={4} duration={200} /> | ||
<div | ||
class="dialog card" | ||
transition:scale={{ | ||
duration: 200 | ||
}} | ||
> | ||
<DialogTitle> | ||
<slot name="title" /> | ||
</DialogTitle> | ||
<DialogDescription> | ||
<slot name="description" /> | ||
</DialogDescription> | ||
</Box> | ||
</Dialog> | ||
<slot /> | ||
</div> | ||
{/if} | ||
|
||
<style lang="scss"> | ||
.dialog { | ||
position: fixed; | ||
z-index: 1000; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
background: var(--theme-surface-2); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: var(--spacing-lg); | ||
@include mixins.desktop { | ||
padding: var(--spacing-xl); | ||
} | ||
} | ||
</style> |
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
Oops, something went wrong.