Skip to content

Commit c86144e

Browse files
committed
re-organise and break down docs
1 parent 466ff08 commit c86144e

File tree

10 files changed

+240
-157
lines changed

10 files changed

+240
-157
lines changed

app/components/CodingLabsLogo.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 425.2 595.28">
3+
<path class="fill-white"
4+
d="M320,220.15l7.7-27-113.68-32.4-7.9,27.73C122.71,191.18,46.92,247,22.81,331.63c-29.88,104.82,30.87,214,135.69,243.89s214-30.87,243.89-135.69C426.74,354.41,390.89,266.09,320,220.15ZM212.6,528A141.51,141.51,0,1,1,354.11,386.45,141.51,141.51,0,0,1,212.6,528Z" />
5+
<circle class="fill-[#f95e08]" cx="325.01" cy="93.07" r="17.74" stroke="currentColor" />
6+
<circle class="fill-[#f95e08]" cx="271.17" cy="328.71" r="18.39" stroke="currentColor" />
7+
<circle class="fill-[#f95e08]" cx="237.07" cy="296.47" r="11.69" stroke="currentColor" />
8+
<path class="fill-[#f95e08]" stroke="currentColor"
9+
d="M322,369.31a69.45,69.45,0,0,1-36.66,13.35c-23.68,1.48-46.8-7.2-68.2-17.44-21-10-42.38-22-65.64-21.48-16.59.4-31.92,7.17-46.41,15.69A110.7,110.7,0,1,0,322,369.31ZM138.63,391.61a15.69,15.69,0,1,1,15.69,15.69A15.69,15.69,0,0,1,138.63,391.61Zm30.58,45.62a8.45,8.45,0,1,1,8.45-8.45A8.45,8.45,0,0,1,169.21,437.23Z" />
10+
<rect class="bg-white" x="212.84" y="113.82" width="141.7" height="38.13"
11+
transform="translate(47.3 -72.68) rotate(15.91)" />
12+
<circle class="fill-[#f95e08]" cx="272.82" cy="65.03" r="10.3" />
13+
<circle class="fill-[#f95e08]" cx="328.47" cy="18.44" r="10.3" />
14+
</svg>
15+
</template>
16+
<script setup lang="ts">
17+
</script>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<script setup lang="ts">
2+
import { useRouter } from "vue-router"
3+
import { type Component, computed } from "vue"
4+
import { ArrowRight } from "lucide-vue-next"
5+
import { Button } from "@/components/button"
6+
import { Heading } from "@"
7+
import ShadcnLogo from "@app/components/ShadcnLogo.vue"
8+
import CodingLabsLogo from "@app/components/CodingLabsLogo.vue"
9+
10+
type Meta = {
11+
layout: Component
12+
shadcn?: boolean | string
13+
modified?: boolean
14+
}
15+
16+
const props = defineProps<{
17+
meta: Meta
18+
}>()
19+
20+
const router = useRouter()
21+
const currentRoute = computed(() => router.currentRoute)
22+
const shadcnRoute = computed(() => {
23+
return props.meta.shadcn === true
24+
? `${currentRoute.value.value.path}`
25+
: `/components/${props.meta.shadcn}`
26+
})
27+
</script>
28+
29+
<template>
30+
<div>
31+
<Heading as="h1">
32+
<div class="flex items-center gap-x-2">
33+
<CodingLabsLogo v-if="!meta.shadcn" class="size-8" />
34+
35+
<ShadcnLogo v-if="meta.shadcn" class="size-8" />
36+
{{ currentRoute.value.name }}
37+
</div>
38+
</Heading>
39+
40+
<h2 class="mt-4 text-2xl font-bold tracking-tight">
41+
{{ currentRoute.value.name }} is a
42+
<template v-if="meta.shadcn">
43+
<span v-if="meta.modified" class="italic">modified</span> Shadcn-vue component.
44+
</template>
45+
46+
<template v-else>
47+
custom component.
48+
</template>
49+
</h2>
50+
51+
<template v-if="meta.shadcn">
52+
<p class="mt-6 text-lg leading-8 text-card-foreground">
53+
<span v-if="meta.modified">
54+
This component is imported from Shadcn Vue
55+
<span class="italic">with</span> modifications.
56+
</span>
57+
58+
<span v-else> This component is imported from Shadcn Vue without modification. </span>
59+
</p>
60+
61+
<div class="mt-10 flex items-center gap-x-6">
62+
<Button as-child>
63+
<a :href="`https://www.shadcn-vue.com/docs${shadcnRoute}`" target="__blank">
64+
See Shadcn Vue Docs
65+
</a>
66+
67+
<ArrowRight />
68+
</Button>
69+
</div>
70+
</template>
71+
</div>
72+
</template>

app/components/ShadcnComponent.vue

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/components/ShadcnLogo.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" class="text-[#41B883]">
3+
<rect width="256" height="256" fill="none"></rect>
4+
<line x1="208" y1="128" x2="128" y2="208" fill="none" stroke="currentColor" stroke-linecap="round"
5+
stroke-linejoin="round" stroke-width="32"></line>
6+
<line x1="192" y1="40" x2="40" y2="192" fill="none" stroke="currentColor" stroke-linecap="round"
7+
stroke-linejoin="round" stroke-width="32"></line>
8+
</svg>
9+
</template>

app/components/SidebarNavigation.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defineEmits<{
1414
</script>
1515

1616
<template>
17-
<nav class="space-y-4 p-4 px-6">
17+
<nav class="space-y-4 px-6">
1818
<div v-for="group in items" :key="group.name">
1919
<h3 class="text-md font-bold leading-6">{{ group.name }}</h3>
2020

@@ -29,10 +29,6 @@ defineEmits<{
2929
>
3030
{{ route.name }}
3131
</RouterLink>
32-
33-
<Badge v-if="!route.meta.shadcn" variant="secondary"> custom </Badge>
34-
35-
<Badge v-if="route.meta.modified"> modified </Badge>
3632
</li>
3733
</ul>
3834
</li>

app/layouts/ComponentLayout.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<script setup lang="ts">
22
import { computed } from "vue"
33
import { useRouter } from "vue-router"
4-
import ShadcnComponent from "@app/components/ShadcnComponent.vue"
4+
import ComponentSummary from "@app/components/ComponentSummary.vue"
55
import { Heading } from "@/components/heading"
66
77
const router = useRouter()
88
const currentRoute = computed(() => router.currentRoute)
99
</script>
1010

1111
<template>
12-
<article>
13-
<Heading as="h1">{{ currentRoute.value.name }}</Heading>
14-
15-
<ShadcnComponent v-if="$route.meta.shadcn" :modified="$route.meta.modified" />
12+
<article class="space-y-6">
13+
<ComponentSummary :meta="$route.meta" />
1614

1715
<hr class="my-8" />
1816

app/pages/components/Slider.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
import { ref } from "vue"
33
import { cn } from "@/lib/utils"
44
import { Slider } from "@/components/slider"
5+
import { Input } from "@/components/input"
56
67
const modelValue = ref([50])
78
</script>
89

910
<template>
10-
<Slider v-model="modelValue" :max="100" :step="1" :class="cn('w-3/5', $attrs.class ?? '')" />
11+
<div class="flex items-center space-x-2">
12+
<Slider v-model="modelValue" :max="100" :step="1" :class="cn('max-w-md', $attrs.class ?? '')" />
13+
14+
<Input v-model="modelValue" class="w-16" disabled />
15+
</div>
1116
</template>

0 commit comments

Comments
 (0)