-
Notifications
You must be signed in to change notification settings - Fork 6
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
alert toast component #248
base: main
Are you sure you want to change the base?
Changes from 28 commits
94572f6
c6df9dd
d439310
f73a83b
62addcd
79117fa
9f149c1
b131ed2
ce95381
e5440ea
0f6eb6c
7e44b33
3d68e60
64ce771
0524edf
7953e4c
3ec5221
2caef63
374c80a
b28f407
14ec3d6
7799dc7
fbd7ca2
7b76630
8ebbcd5
8a9b369
5a41e1c
43e9d83
6ed401f
1e1d2f0
f724101
8b26112
468be67
18f3575
b64c389
de4a5e7
e6a1d47
8859247
4509f67
e200e7b
cbe1b01
6ad6208
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<template> | ||
<PageHeader> | ||
Alert | ||
<template #description> | ||
Light and beautiful codex alert | ||
<code>click the button to see for yourself </code> | ||
</template> | ||
</PageHeader> | ||
|
||
<p>The following outlines options for alert to display </p> | ||
|
||
<div class="flex-content"> | ||
<div> | ||
Message - message of the alert to be displayed (string) | ||
</div> | ||
|
||
<div> | ||
Position - position of alert (bottom-center) | ||
</div> | ||
|
||
<div> | ||
Type - alert type (success, error, warning, info and default) | ||
</div> | ||
|
||
<div> | ||
Timeout - Visibility duration in milliseconds, set timeout to keep toast visible | ||
</div> | ||
</div> | ||
|
||
<div class="flex-type"> | ||
<div class="flex"> | ||
neSpecc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span>Success</span> | ||
<Button | ||
@click="showToast('success')" | ||
iamgabrielsoft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
click success | ||
neSpecc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Button> | ||
</div> | ||
|
||
<div class="flex"> | ||
<span>Error</span> | ||
<Button | ||
@click="showToast('error')" | ||
> | ||
click error | ||
</Button> | ||
</div> | ||
|
||
<div class="flex"> | ||
<span>Warning</span> | ||
<Button | ||
@click="showToast('warning')" | ||
> | ||
click warning | ||
</Button> | ||
</div> | ||
|
||
<div class="flex"> | ||
<span>Info</span> | ||
<Button | ||
@click="showToast('info')" | ||
> | ||
click info | ||
</Button> | ||
</div> | ||
|
||
<div class="flex"> | ||
<span>Default</span> | ||
<Button | ||
@click="showToast('default')" | ||
> | ||
click default | ||
</Button> | ||
</div> | ||
</div> | ||
|
||
<AlertContainer /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets move it to the root component (Playground.vue) to reuse the single container for the whole app There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still actual |
||
</template> | ||
|
||
<script setup lang="ts"> | ||
import PageHeader from '../../components/PageHeader.vue'; | ||
import { Button, useAlert, AlertContainer, AlertType } from '../../../src/vue'; | ||
|
||
const toast = useAlert; | ||
|
||
const showToast = (status: AlertType) => { | ||
toast(status, { | ||
message: 'codex', | ||
icon: 'Check', | ||
type: status, | ||
timeout: 5000, | ||
}); | ||
}; | ||
|
||
</script> | ||
|
||
<style lang="postcss"> | ||
.flex-content { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
gap: var(--spacing-l); | ||
align-items: center; | ||
} | ||
|
||
.flex-type { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 3rem; | ||
margin-top: 2rem; | ||
|
||
.flex { | ||
display: grid; | ||
grid-template-columns: repeat(2, max-content); | ||
gap: var(--spacing-l); | ||
align-items: center; | ||
} | ||
} | ||
</style> |
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.
seems redundant. Describe a bug in details please