✨ feat (ui): add radix vue components library
This commit is contained in:
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationEllipsisProps } from 'radix-vue'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { PaginationEllipsis } from 'radix-vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<PaginationEllipsisProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = computed(() => {
|
||||
const { class: _, ...delegated } = props
|
||||
|
||||
return delegated
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PaginationEllipsis v-bind="delegatedProps" :class="cn('w-9 h-9 flex items-center justify-center', props.class)">
|
||||
<slot>
|
||||
<Icon name="i-radix-icons-dots-horizontal" />
|
||||
</slot>
|
||||
</PaginationEllipsis>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationFirstProps } from 'radix-vue'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import {
|
||||
Button,
|
||||
} from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { PaginationFirst } from 'radix-vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<PaginationFirstProps & { class?: HTMLAttributes['class'] }>(), {
|
||||
asChild: true,
|
||||
})
|
||||
|
||||
const delegatedProps = computed(() => {
|
||||
const { class: _, ...delegated } = props
|
||||
|
||||
return delegated
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PaginationFirst v-bind="delegatedProps">
|
||||
<Button :class="cn('w-9 h-9 p-0', props.class)" variant="outline">
|
||||
<slot>
|
||||
<Icon name="i-radix-icons-double-arrow-left" />
|
||||
</slot>
|
||||
</Button>
|
||||
</PaginationFirst>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationLastProps } from 'radix-vue'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import {
|
||||
Button,
|
||||
} from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { PaginationLast } from 'radix-vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<PaginationLastProps & { class?: HTMLAttributes['class'] }>(), {
|
||||
asChild: true,
|
||||
})
|
||||
|
||||
const delegatedProps = computed(() => {
|
||||
const { class: _, ...delegated } = props
|
||||
|
||||
return delegated
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PaginationLast v-bind="delegatedProps">
|
||||
<Button :class="cn('w-9 h-9 p-0', props.class)" variant="outline">
|
||||
<slot>
|
||||
<Icon name="i-radix-icons-double-arrow-right" />
|
||||
</slot>
|
||||
</Button>
|
||||
</PaginationLast>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationNextProps } from 'radix-vue'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import {
|
||||
Button,
|
||||
} from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { PaginationNext } from 'radix-vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<PaginationNextProps & { class?: HTMLAttributes['class'] }>(), {
|
||||
asChild: true,
|
||||
})
|
||||
|
||||
const delegatedProps = computed(() => {
|
||||
const { class: _, ...delegated } = props
|
||||
|
||||
return delegated
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PaginationNext v-bind="delegatedProps">
|
||||
<Button :class="cn('w-9 h-9 p-0', props.class)" variant="outline">
|
||||
<slot>
|
||||
<Icon name="i-radix-icons-chevron-right" />
|
||||
</slot>
|
||||
</Button>
|
||||
</PaginationNext>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationPrevProps } from 'radix-vue'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import {
|
||||
Button,
|
||||
} from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { PaginationPrev } from 'radix-vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<PaginationPrevProps & { class?: HTMLAttributes['class'] }>(), {
|
||||
asChild: true,
|
||||
})
|
||||
|
||||
const delegatedProps = computed(() => {
|
||||
const { class: _, ...delegated } = props
|
||||
|
||||
return delegated
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PaginationPrev v-bind="delegatedProps">
|
||||
<Button :class="cn('w-9 h-9 p-0', props.class)" variant="outline">
|
||||
<slot>
|
||||
<Icon name="i-radix-icons-chevron-left" />
|
||||
</slot>
|
||||
</Button>
|
||||
</PaginationPrev>
|
||||
</template>
|
||||
@@ -0,0 +1,10 @@
|
||||
export { default as PaginationEllipsis } from './PaginationEllipsis.vue'
|
||||
export { default as PaginationFirst } from './PaginationFirst.vue'
|
||||
export { default as PaginationLast } from './PaginationLast.vue'
|
||||
export { default as PaginationNext } from './PaginationNext.vue'
|
||||
export { default as PaginationPrev } from './PaginationPrev.vue'
|
||||
export {
|
||||
PaginationRoot as Pagination,
|
||||
PaginationList,
|
||||
PaginationListItem,
|
||||
} from 'radix-vue'
|
||||
Reference in New Issue
Block a user