forked from jd-solanki/anu
-
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(ALoader): new component (jd-solanki#119)
Co-authored-by: JD Solanki <jdsolanki0001@gmail.com>
- Loading branch information
1 parent
a11c4bc
commit d0fb060
Showing
34 changed files
with
4,028 additions
and
1,316 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
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,56 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
const loading = ref(false) | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-wrap gap-6"> | ||
<ABtn | ||
:loading="loading" | ||
color="danger" | ||
@click="loading = !loading" | ||
> | ||
Click to load | ||
</ABtn> | ||
<ABtn | ||
:loading="loading" | ||
variant="outline" | ||
@click="loading = !loading" | ||
> | ||
Click to load | ||
</ABtn> | ||
<ABtn | ||
:loading="loading" | ||
color="success" | ||
variant="light" | ||
@click="loading = !loading" | ||
> | ||
Click to load | ||
</ABtn> | ||
<ABtn | ||
:loading="loading" | ||
class="flex-1" | ||
@click="loading = !loading" | ||
> | ||
Click to load | ||
</ABtn> | ||
<ABtn | ||
:loading="loading" | ||
icon="i-bx-wink-smile" | ||
@click="loading = !loading" | ||
> | ||
Loading icon button | ||
</ABtn> | ||
|
||
<ABtn | ||
:loading="loading" | ||
color="info" | ||
variant="light" | ||
class="text-2xl" | ||
icon-only | ||
icon="i-bx-dollar-circle" | ||
@click="loading = !loading" | ||
/> | ||
</div> | ||
</template> |
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,6 @@ | ||
<template> | ||
<div class="flex flex-col gap-4"> | ||
<ALoader /> | ||
<p>You can also use the component <ALoader /> inline.</p> | ||
</div> | ||
</template> |
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,13 @@ | ||
<template> | ||
<div class="flex justify-between text-4xl"> | ||
<ALoader color="primary" /> | ||
<ALoader color="success" /> | ||
<ALoader color="info" /> | ||
<ALoader color="warning" /> | ||
<ALoader color="danger" /> | ||
|
||
<p class="text-orange-500 flex gap-2"> | ||
Orange text <ALoader /> | ||
</p> | ||
</div> | ||
</template> |
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,126 @@ | ||
<script lang="ts" setup> | ||
import { useTimeout } from '@vueuse/core' | ||
import { ref } from 'vue' | ||
const { ready, start, stop } = useTimeout(1000, { controls: true }) | ||
const isDialogShown = ref(false) | ||
const isDrawerShown = ref(false) | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-wrap gap-6"> | ||
<!-- Alert --> | ||
<AAlert | ||
color="info" | ||
variant="fill" | ||
class="relative" | ||
@click="ready && start()" | ||
> | ||
AAlert component. Click to start loading... | ||
<ALoader | ||
:loading="!ready" | ||
overlay | ||
class="text-2xl" | ||
/> | ||
</AAlert> | ||
|
||
<!-- Card --> | ||
<ACard | ||
variant="fill" | ||
color="danger" | ||
title="Card title" | ||
subtitle="Chocolate cake tiramisu donut" | ||
@click="ready && start()" | ||
> | ||
<div class="a-card-body a-card-spacer"> | ||
<p class="text-sm"> | ||
<ALoader | ||
:loading="!ready" | ||
overlay | ||
class="text-3xl" | ||
title="It's loading..." | ||
subtitle="Click to stop loading." | ||
@click.stop="stop()" | ||
/> | ||
Ice cream sweet pie pie dessert sweet danish. Jelly jelly beans cupcake jelly-o chocolate bonbon chocolate | ||
bar. | ||
</p> | ||
</div> | ||
</ACard> | ||
|
||
<!-- Dialog --> | ||
<ADialog | ||
v-model="isDialogShown" | ||
title="Dialog title" | ||
subtitle="Chocolate cake tiramisu donut" | ||
text="Ice cream sweet pie pie dessert sweet danish. Jelly jelly beans cupcake jelly-o chocolate bonbon chocolate bar." | ||
> | ||
<ALoader | ||
:loading="!ready" | ||
overlay | ||
class="text-6xl bg-white" | ||
/> | ||
</ADialog> | ||
|
||
<ABtn @click="isDialogShown = true; start()"> | ||
Show dialog | ||
</ABtn> | ||
|
||
<!-- Drawer --> | ||
<ADrawer | ||
v-model="isDrawerShown" | ||
title="Drawer title" | ||
subtitle="Chocolate cake tiramisu donut" | ||
> | ||
<ALoader | ||
:loading="!ready" | ||
overlay | ||
class="text-6xl bg-white" | ||
/> | ||
</ADrawer> | ||
|
||
<ABtn @click="isDrawerShown = true; start()"> | ||
Show drawer | ||
</ABtn> | ||
|
||
<div class="flex gap-6"> | ||
<!-- Badge --> | ||
<ABadge :content="9"> | ||
<ABtn | ||
:loading="!ready" | ||
@click="ready && start()" | ||
> | ||
Button | ||
</ABtn> | ||
</ABadge> | ||
|
||
<!-- Button --> | ||
<ABtn | ||
:loading="!ready" | ||
icon="i-bx-wink-smile" | ||
@click="ready && start()" | ||
> | ||
Loading icon | ||
</ABtn> | ||
|
||
<ABtn | ||
color="success" | ||
variant="light" | ||
class="text-2xl" | ||
:loading="!ready" | ||
icon-only | ||
icon="i-bx-dollar-circle" | ||
@click="ready && start()" | ||
/> | ||
|
||
<!-- Input --> | ||
<AInput | ||
:loading="!ready" | ||
placeholder="Type to load" | ||
append-inner-icon="i-bx-check-double" | ||
@keypress="ready && start()" | ||
/> | ||
</div> | ||
</div> | ||
</template> |
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,24 @@ | ||
<template> | ||
<div class="flex gap-8 text-3xl"> | ||
<ALoader class="[--a-ring-stroke:10] [--a-arc-stroke:10]" /> | ||
|
||
<ALoader | ||
color="primary" | ||
class="[--a-ring-color:hsla(var(--a-base-color),0.1)] [--a-ring-opacity:1] [--a-spin-duration:1.5s]" | ||
/> | ||
|
||
<ALoader class="[--a-ring-stroke:0] [&_.a-spinner-arc]-stroke-cap-round rotate-y-180" /> | ||
|
||
<ALoader class="[--a-ring-stroke:180] [--a-arc-stroke:10] [--a-ring-opacity:.5] [--a-arc-color:white] dark:[--a-arc-color:black] animate-pulse-alt" /> | ||
|
||
<ALoader | ||
color="success" | ||
class="[--a-ring-stroke:0] hover:[--a-spin-duration:4s] stroke-cap-round animate-circular-dash" | ||
/> | ||
|
||
<ALoader | ||
color="primary" | ||
class="[--a-ring-stroke:200] [--a-arc-stroke:200] animate-circular-dash" | ||
/> | ||
</div> | ||
</template> |
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,20 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
const loading = ref(false) | ||
</script> | ||
|
||
<template> | ||
<ABtn @click="loading = !loading"> | ||
Loading in full page mode | ||
</ABtn> | ||
|
||
<ALoader | ||
:loading="loading" | ||
full-page | ||
title="Full page loading" | ||
subtitle="Click anywhere to stop loading" | ||
class="text-4xl bg-white dark:bg-dark" | ||
@click="loading = false" | ||
/> | ||
</template> |
Oops, something went wrong.