-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* raw: layout * raw: template grid areas * feat(layout): area order * feat: layout with animations * feat: layout with absolute drawers * feat(layout): use better prop config * chore(layout): improve demo * fix(layout): improve docs * feat(layout): improve docs demo
- Loading branch information
Showing
17 changed files
with
1,001 additions
and
2 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
50 changes: 50 additions & 0 deletions
50
packages/docs/page-config/ui-elements/layout/examples/Absolute.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,50 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(true) | ||
</script> | ||
|
||
<template> | ||
<VaLayout | ||
style="height: 500px" | ||
:left="{ absolute: true}" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
94 changes: 94 additions & 0 deletions
94
packages/docs/page-config/ui-elements/layout/examples/AllSlots.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,94 @@ | ||
<script setup lang="ts"> | ||
const showLeftSidebar = ref(true) | ||
const showRightSidebar = ref(true) | ||
</script> | ||
|
||
<template> | ||
<VaLayout style="height: 500px"> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showLeftSidebar = !showLeftSidebar" :icon="showLeftSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
<template #right> | ||
<VaButton @click="showRightSidebar = !showRightSidebar" :icon="showRightSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showLeftSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="bolt" /> | ||
<VaSidebarItemTitle> | ||
Features | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="arrow_upward" /> | ||
<VaSidebarItemTitle> | ||
Scroll back | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
|
||
<template #right> | ||
<VaSidebar v-model="showRightSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="favorite" /> | ||
<VaSidebarItemTitle> | ||
Favorite components | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="grade" /> | ||
<VaSidebarItemTitle> | ||
Best practices | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #bottom> | ||
<footer class="p-4 border-[var(--va-background-border)] border-t-2 text-right"> | ||
Footer | ||
</footer> | ||
</template> | ||
</VaLayout> | ||
</template> |
47 changes: 47 additions & 0 deletions
47
packages/docs/page-config/ui-elements/layout/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,47 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(false) | ||
</script> | ||
|
||
<template> | ||
<VaLayout style="height: 500px"> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
52 changes: 52 additions & 0 deletions
52
packages/docs/page-config/ui-elements/layout/examples/MobileFriendly.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,52 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(true) | ||
const breakpoints = useBreakpoint() | ||
</script> | ||
|
||
<template> | ||
<VaLayout | ||
style="height: 500px" | ||
:left="{ absolute: breakpoints.smDown }" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
92 changes: 92 additions & 0 deletions
92
packages/docs/page-config/ui-elements/layout/examples/Order.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,92 @@ | ||
<script setup lang="ts"> | ||
const showLeftSidebar = ref(true) | ||
const showRightSidebar = ref(true) | ||
const orders = reactive({ | ||
left: 2, | ||
top: 1, | ||
right: 2, | ||
bottom: 1, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="mb-4 flex gap-2 justify-between flex-wrap"> | ||
<VaCounter v-model="orders.top" label="top" /> | ||
<VaCounter v-model="orders.left" label="left" /> | ||
<VaCounter v-model="orders.right" label="right" /> | ||
<VaCounter v-model="orders.bottom" label="bottom" /> | ||
</div> | ||
|
||
<VaLayout | ||
:left="{ order: orders.left }" | ||
:top="{ order: orders.top }" | ||
:right="{ order: orders.right }" | ||
:bottom="{ order: orders.bottom }" | ||
style="height: 500px" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showLeftSidebar = !showLeftSidebar" :icon="showLeftSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
<template #right> | ||
<VaButton @click="showRightSidebar = !showRightSidebar" :icon="showRightSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showLeftSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
|
||
<template #right> | ||
<VaSidebar v-model="showRightSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> Home | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> About | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #bottom> | ||
<footer class="p-4 border-[var(--va-background-border)] border-t-2 text-right"> | ||
Footer | ||
</footer> | ||
</template> | ||
</VaLayout> | ||
</template> |
Oops, something went wrong.