File tree Expand file tree Collapse file tree 6 files changed +71
-0
lines changed
Expand file tree Collapse file tree 6 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { Separator } from " @/components/separator"
3+ </script >
4+
5+ <template >
6+ <div class =" w-64" >
7+ <div class =" space-y-1" >
8+ <h4 class =" text-sm font-medium leading-none" >Radix Primitives</h4 >
9+
10+ <p class =" text-sm text-muted-foreground" >An open-source UI component library.</p >
11+ </div >
12+
13+ <Separator class =" my-4" label =" Or" />
14+
15+ <div class =" flex h-5 items-center space-x-4 text-sm" >
16+ <div >Blog</div >
17+
18+ <Separator orientation =" vertical" />
19+
20+ <div >Docs</div >
21+
22+ <Separator orientation =" vertical" />
23+
24+ <div >Source</div >
25+ </div >
26+ </div >
27+ </template >
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export { default as Flasher } from "./components/Flasher.vue"
1717export { default as Pagination } from "./components/Pagination.vue"
1818export { default as Popover } from "./components/Popover.vue"
1919export { default as Progress } from "./components/Progress.vue"
20+ export { default as Separator } from "./components/Separator.vue"
2021export { default as Skeleton } from "./components/Skeleton.vue"
2122export { default as Toast } from "./components/Toast.vue"
2223export { default as Tip } from "./components/Tip.vue"
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
2020 Pagination ,
2121 Popover ,
2222 Progress ,
23+ Separator ,
2324 Skeleton ,
2425 Toast ,
2526 Tip ,
@@ -146,6 +147,12 @@ const routes = [
146147 component : Progress ,
147148 meta : { layout : ComponentLayout , shadcn : true } ,
148149 } ,
150+ {
151+ name : "Separator" ,
152+ path : "/components/separator" ,
153+ component : Separator ,
154+ meta : { layout : ComponentLayout , shadcn : true } ,
155+ } ,
149156 {
150157 name : "Skeleton" ,
151158 path : "/components/skeleton" ,
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from " vue"
3+ import { reactiveOmit } from " @vueuse/core"
4+ import { Separator , type SeparatorProps } from " reka-ui"
5+ import { cn } from " @/lib/utils"
6+
7+ const props = defineProps <SeparatorProps & { class? : HTMLAttributes [" class" ]; label? : string }>()
8+
9+ const delegatedProps = reactiveOmit (props , " class" )
10+ </script >
11+
12+ <template >
13+ <Separator
14+ v-bind =" delegatedProps"
15+ :class ="
16+ cn(
17+ 'shrink-0 bg-border relative',
18+ props.orientation === 'vertical' ? 'w-px h-full' : 'h-px w-full',
19+ props.class
20+ )
21+ "
22+ >
23+ <span
24+ v-if =" props.label"
25+ :class ="
26+ cn(
27+ 'text-xs text-muted-foreground bg-background absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex justify-center items-center',
28+ props.orientation === 'vertical' ? 'w-[1px] px-1 py-2' : 'h-[1px] py-1 px-2'
29+ )
30+ "
31+ >{{ props.label }}</span
32+ >
33+ </Separator >
34+ </template >
Original file line number Diff line number Diff line change 1+ export { default as Separator } from "./Separator.vue"
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export * from "@/components/label"
2727export * from "@/components/popover"
2828export * from "@/components/progress"
2929export * from "@/components/select"
30+ export * from "@/components/separator"
3031export * from "@/components/sheet"
3132export * from "@/components/skeleton"
3233export * from "@/components/slider"
You can’t perform that action at this time.
0 commit comments