shadcn-vue/apps/www/.vitepress/theme/components/MobileNav.vue
zernonia 77c6a16040
feat: Charts (#166)
* chore: update unovis deps

* chore: update color to use the themePrimary

* docs: use gradient for overview component

* docs: add themePopover to MainLayout

* docs: enable global theme on every page

* feat: introduce area, line, bar, donut chart

* feat: add more props

* fix: revert old pipeline

* fix: patch @unovis/vue deps

* fix: patch @unovis/vue deps again

* chore: revert unovis/ts to 1.2.1

* chore: wip

* docs: add alpha tag, fix tooltipo styling

* docs: add charts installations step

* feat: use generic, add better color

* chore: build registry

* feat: improve generic props

* chore: build registry

* docs: add alpha label

* fix: collapsible not open correctly

* docs: add badge to mobile nav

* chore: better types

* chore: run registry

* chore: wip

* fix: crosshair issue

* chore: fix type, import missing error

* chore: build registry

* chore: arrange interface, expose margin, slot

* chore: build registry

* docs: guide page
feat: add prop to barchart

* chore: fix pnpm-lock

* chore: add feature

* chore: run build registry

* refactor: change color var

* feat: codegen

* chore: add meta tables

* feat: add line, area example

* feat: bar and donut examples

* docs: codege

* chore: build registry

* docs: improve chart doc

* chore: fix missing icon package
2024-05-01 11:34:58 +08:00

94 lines
2.8 KiB
Vue

<script setup lang="ts">
import { ref } from 'vue'
import { docsConfig } from '../config/docs'
import Logo from './Logo.vue'
import { Sheet, SheetContent, SheetTrigger } from '@/lib/registry/default/ui/sheet'
import { Button } from '@/lib/registry/default/ui/button'
import { ScrollArea } from '@/lib/registry/default/ui/scroll-area'
import { Badge } from '@/lib/registry/new-york/ui/badge'
const open = ref(false)
</script>
<template>
<Sheet v-model:open="open">
<SheetTrigger as-child>
<Button
variant="ghost"
class="mr-2 px-2 text-base flex-shrink-0 hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 md:hidden"
>
<svg
strokeWidth="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
>
<path
d="M3 5H11"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M3 12H16"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M3 19H21"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<span class="sr-only">Toggle Menu</span>
</Button>
</SheetTrigger>
<SheetContent side="left" class="pr-0">
<Logo @click="open = false" />
<ScrollArea class="my-4 h-[calc(100vh-8rem)] pb-10 pl-6">
<div class="flex flex-col space-y-3">
<a
v-for="item in docsConfig.mainNav"
:key="item.href"
:href="item.href"
@click="open = false"
>
{{ item.title }}
</a>
</div>
<div class="flex flex-col space-y-2">
<div v-for="(items, index) in docsConfig.sidebarNav" :key="index" class="flex flex-col space-y-3 pt-6">
<div class="flex items-center">
<h4 class="font-medium">
{{ items.title }}
</h4>
<Badge v-if="items.label" class="ml-2">
{{ items.label }}
</Badge>
</div>
<a
v-for="item in items.items" :key="item.href"
:href="item.href"
class="text-muted-foreground inline-flex items-center"
@click="open = false"
>
{{ item.title }}
<Badge v-if="item.label" class="ml-2">
{{ item.label }}
</Badge>
</a>
</div>
</div>
</ScrollArea>
</SheetContent>
</Sheet>
</template>