-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(skeleton): init skeleton component * chore: minor refactor * chore: refactoring * remove old odcs * docs(skeleton): init skeleton docs * feat(skeleton): rename textWidth to lastLineWidth * feat(skeleton): changed demos * feat(skeleton): css variables * feat(skeleton): added new badge in docs * feat(skeleton): accessability improvement * fix(skeleton): wave animation on text * docs(skeleton): loading example
- Loading branch information
Showing
27 changed files
with
681 additions
and
8 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
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 @@ | ||
export default defineManualApi({}); |
79 changes: 79 additions & 0 deletions
79
packages/docs/page-config/ui-elements/skeleton/components/Playground.vue
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,79 @@ | ||
<template> | ||
<ComponentPlayground | ||
v-slot="{ bind, slots }" | ||
:options="options" | ||
:code="renderComponent('va-skeleton')" | ||
:slots="slots" | ||
> | ||
<VaCard class="w-full"> | ||
<VaCardContent> | ||
<VaSkeleton v-bind="bind"> | ||
<template v-for="slot in slots" #[slot.name]> | ||
{{ slot.value }} | ||
</template> | ||
</VaSkeleton> | ||
</VaCardContent> | ||
</VaCard> | ||
</ComponentPlayground> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useComponentPlayground } from "@/composables/useComponentPlayground"; | ||
const { options, renderComponent, slots } = useComponentPlayground({ | ||
variant: { | ||
type: "select", | ||
value: "squared", | ||
options: ["squared", "circle", "rounded", "text"], | ||
}, | ||
height: { | ||
type: "input", | ||
value: "", | ||
rules: [ | ||
(v: string) => | ||
/(\d(\%|rem|em|px))$/.test(v) || "Height must be a css size", | ||
], | ||
}, | ||
width: { | ||
type: "input", | ||
value: "", | ||
rules: [ | ||
(v: string) => /(\d(\%|rem|em|px))$/.test(v) || "Must must be css size", | ||
], | ||
}, | ||
color: { | ||
type: "input", | ||
value: "", | ||
}, | ||
animation: { | ||
type: "select", | ||
value: "pulse", | ||
options: ["pulse", "wave", "none"], | ||
}, | ||
gradient: { | ||
type: "checkbox", | ||
value: false, | ||
}, | ||
// Text | ||
lines: { | ||
type: "input", | ||
value: "", | ||
hidden: (props) => props.variant !== "text", | ||
rules: [(v: string) => /\d$/.test(v) || "Must must be a number"], | ||
}, | ||
lastLineWidth: { | ||
type: "input", | ||
value: "", | ||
hidden: (props) => props.variant !== "text", | ||
rules: [ | ||
(v: string) => /(\d(\%|rem|em|px))$/.test(v) || "Must must be css size", | ||
], | ||
}, | ||
lineGap: { | ||
type: "input", | ||
value: "", | ||
hidden: (props) => props.variant !== "text", | ||
rules: [(v: string) => /\d$/.test(v) || "Must must be a number"], | ||
}, | ||
}); | ||
</script> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Circle.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton variant="circle" height="4rem" /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Default.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton /> | ||
</template> |
18 changes: 18 additions & 0 deletions
18
packages/docs/page-config/ui-elements/skeleton/examples/Group.vue
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,18 @@ | ||
<template> | ||
<VaSkeletonGroup> | ||
<VaCard> | ||
<VaSkeleton variant="squared" height="120px" /> | ||
<va-card-content style="display: flex; align-items: center;"> | ||
<VaSkeleton variant="circle" width="1rem" height="48px" /> | ||
<VaSkeleton variant="text" class="ml-2" :lines="2" /> | ||
</va-card-content> | ||
<va-card-content> | ||
<VaSkeleton variant="text" :lines="4" text-width="50%" /> | ||
</va-card-content> | ||
<va-card-actions style="display: flex; justify-content: end;"> | ||
<VaSkeleton class="mr-2" variant="rounded" inline width="64px" height="32px" /> | ||
<VaSkeleton variant="rounded" inline width="64px" height="32px" /> | ||
</va-card-actions> | ||
</VaCard> | ||
</VaSkeletonGroup> | ||
</template> |
14 changes: 14 additions & 0 deletions
14
packages/docs/page-config/ui-elements/skeleton/examples/GroupWave.vue
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,14 @@ | ||
<template> | ||
<VaSkeletonGroup animation="wave"> | ||
<VaCard> | ||
<va-card-content style="display: flex; align-items: center;"> | ||
<VaSkeleton variant="circle" width="1rem" height="48px" /> | ||
<VaSkeleton variant="text" class="ml-2" :lines="2" /> | ||
</va-card-content> | ||
<va-card-actions style="display: flex; justify-content: end;"> | ||
<VaSkeleton class="mr-2" variant="rounded" inline width="64px" height="32px" /> | ||
<VaSkeleton variant="rounded" inline width="64px" height="32px" /> | ||
</va-card-actions> | ||
</VaCard> | ||
</VaSkeletonGroup> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Headline.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton tag="h1" variant="text" class="va-h1" /> | ||
</template> |
51 changes: 51 additions & 0 deletions
51
packages/docs/page-config/ui-elements/skeleton/examples/Loading.vue
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,51 @@ | ||
<template> | ||
<div :aria-busy="isLoading"> | ||
<VaSkeletonGroup v-if="isLoading" animation="wave" :delay="0"> | ||
<VaCard> | ||
<va-card-content style="display: flex; align-items: center;"> | ||
<VaSkeleton variant="circle" width="1rem" height="48px" /> | ||
<VaSkeleton variant="text" class="ml-2 va-text" :lines="2" /> | ||
</va-card-content> | ||
<va-card-actions style="display: flex; justify-content: end;"> | ||
<VaSkeleton class="mr-2" variant="rounded" inline width="82px" height="32px" /> | ||
<VaSkeleton variant="rounded" inline width="64px" height="32px" /> | ||
</va-card-actions> | ||
</VaCard> | ||
</VaSkeletonGroup> | ||
|
||
<VaCard v-else> | ||
<va-card-content style="display: flex; align-items: center;"> | ||
<VaAvatar src="https://i.pinimg.com/280x280_RS/08/e9/ba/08e9ba9cbd24db8de0c250570af460a4.jpg" /> | ||
<p class="ml-2 mb-0 va-text"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed | ||
tincidunt, nisl eget aliquam tincidunt, nisl nisl aliquam | ||
tortor, eget aliquam nisl nisl sit amet lorem. | ||
</p> | ||
</va-card-content> | ||
|
||
<va-card-actions style="display: flex; justify-content: end;"> | ||
<va-button color="primary">Message</va-button> | ||
<va-button color="secondary">Follow</va-button> | ||
</va-card-actions> | ||
</VaCard> | ||
|
||
<va-divider class="my-8" /> | ||
|
||
<va-button @click="load">Load</va-button> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
const isLoading = ref(true) | ||
const load = () => { | ||
isLoading.value = true | ||
setTimeout(() => { | ||
isLoading.value = false | ||
}, 2000) | ||
} | ||
onMounted(load) | ||
</script> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Rounded.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton variant="rounded" inline width="64px" height="32px" /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Square.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton variant="squared" height="10rem" /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/docs/page-config/ui-elements/skeleton/examples/Text.vue
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,3 @@ | ||
<template> | ||
<VaSkeleton variant="text" :lines="2" /> | ||
</template> |
Oops, something went wrong.