chore(components): improve props

This commit is contained in:
Benjamin Canac
2024-06-28 18:13:03 +02:00
parent c9f9a248b7
commit 673064dee5
38 changed files with 260 additions and 137 deletions

View File

@@ -1,6 +1,5 @@
<script lang="ts">
import { tv } from 'tailwind-variants'
import type { PrimitiveProps } from 'radix-vue'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
import theme from '#build/ui/container'
@@ -9,7 +8,12 @@ const appConfig = _appConfig as AppConfig & { ui: { container: Partial<typeof th
const container = tv({ extend: tv(theme), ...(appConfig.ui?.container || {}) })
export interface ContainerProps extends Omit<PrimitiveProps, 'asChild'> {
export interface ContainerProps {
/**
* The element or component this component should render as.
* @defaultValue 'div'
*/
as?: any
class?: any
}
@@ -21,7 +25,7 @@ export interface ContainerSlots {
<script setup lang="ts">
import { Primitive } from 'radix-vue'
const props = withDefaults(defineProps<ContainerProps>(), { as: 'div' })
const props = defineProps<ContainerProps>()
defineSlots<ContainerSlots>()
</script>