File tree Expand file tree Collapse file tree 12 files changed +198
-0
lines changed Expand file tree Collapse file tree 12 files changed +198
-0
lines changed Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { ArrowUpRightIcon , FolderCode } from " lucide-vue-next"
3+ import { Button } from " @/components/button"
4+ import {
5+ Empty ,
6+ EmptyContent ,
7+ EmptyDescription ,
8+ EmptyHeader ,
9+ EmptyMedia ,
10+ EmptyTitle ,
11+ } from " @/components/empty"
12+ </script >
13+
14+ <template >
15+ <Empty >
16+ <EmptyHeader >
17+ <EmptyMedia variant =" icon" >
18+ <FolderCode />
19+ </EmptyMedia >
20+
21+ <EmptyTitle >No Projects Yet</EmptyTitle >
22+
23+ <EmptyDescription >
24+ You haven't created any projects yet. Get started by creating your first project.
25+ </EmptyDescription >
26+ </EmptyHeader >
27+
28+ <EmptyContent >
29+ <div class =" flex gap-2" >
30+ <Button >Create Project</Button >
31+
32+ <Button variant =" outline" > Import Project </Button >
33+ </div >
34+ </EmptyContent >
35+
36+ <Button variant =" link" as-child class =" text-muted-foreground" size =" sm" >
37+ <a href =" #" > Learn More <ArrowUpRightIcon /> </a >
38+ </Button >
39+ </Empty >
40+ </template >
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export { default as ConfirmDialog } from "./components/ConfirmDialog.vue"
2323export { default as Dialog } from "./components/Dialog.vue"
2424export { default as Drawer } from "./components/Drawer.vue"
2525export { default as DropdownMenu } from "./components/DropdownMenu.vue"
26+ export { default as Empty } from "./components/Empty.vue"
2627export { default as Flasher } from "./components/Flasher.vue"
2728export { default as Heading } from "./components/Heading.vue"
2829export { default as Input } from "./components/Input.vue"
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
2727 Dialog ,
2828 Drawer ,
2929 DropdownMenu ,
30+ Empty ,
3031 Flasher ,
3132 Heading ,
3233 Input ,
@@ -138,6 +139,12 @@ const routes = [
138139 component : DropdownMenu ,
139140 meta : { layout : ComponentLayout , shadcn : true } ,
140141 } ,
142+ {
143+ name : "Empty" ,
144+ path : "/components/empty" ,
145+ component : Empty ,
146+ meta : { layout : ComponentLayout , shadcn : true } ,
147+ } ,
141148 {
142149 name : "Flasher" ,
143150 path : "/components/flasher" ,
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [" class" ]
7+ }>()
8+ </script >
9+
10+ <template >
11+ <div
12+ data-slot =" empty"
13+ :class ="
14+ cn(
15+ 'flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12',
16+ props.class
17+ )
18+ "
19+ >
20+ <slot />
21+ </div >
22+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [" class" ]
7+ }>()
8+ </script >
9+
10+ <template >
11+ <div
12+ data-slot =" empty-content"
13+ :class ="
14+ cn(
15+ 'flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm',
16+ props.class
17+ )
18+ "
19+ >
20+ <slot />
21+ </div >
22+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [" class" ]
7+ }>()
8+ </script >
9+
10+ <template >
11+ <p
12+ data-slot =" empty-description"
13+ :class ="
14+ cn(
15+ 'text-muted-foreground [& >a:hover]:text-primary text-sm/relaxed [& >a]:underline [& >a]:underline-offset-4',
16+ props.class
17+ )
18+ "
19+ >
20+ <slot />
21+ </p >
22+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [" class" ]
7+ }>()
8+ </script >
9+
10+ <template >
11+ <div
12+ data-slot =" empty-header"
13+ :class =" cn('flex max-w-sm flex-col items-center gap-2 text-center', props.class)"
14+ >
15+ <slot />
16+ </div >
17+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+ import { emptyMediaVariants } from " ."
5+ import type { EmptyMediaVariants } from " ."
6+
7+ const props = defineProps <{
8+ class? : HTMLAttributes [" class" ]
9+ variant? : EmptyMediaVariants [" variant" ]
10+ }>()
11+ </script >
12+
13+ <template >
14+ <div
15+ data-slot =" empty-icon"
16+ :data-variant =" variant"
17+ :class =" cn(emptyMediaVariants({ variant }), props.class)"
18+ >
19+ <slot />
20+ </div >
21+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { cn } from " @/lib/utils"
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [" class" ]
7+ }>()
8+ </script >
9+
10+ <template >
11+ <div data-slot =" empty-title" :class =" cn('text-lg font-medium tracking-tight', props.class)" >
12+ <slot />
13+ </div >
14+ </template >
Original file line number Diff line number Diff line change 1+ describe ( "template spec" , ( ) => {
2+ it ( "passes" , ( ) => {
3+ cy . visit ( "/components/empty" )
4+ } )
5+ } )
You can’t perform that action at this time.
0 commit comments