mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
chore(components): improve props
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { tv, type VariantProps } 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/kbd'
|
||||
@@ -12,7 +11,12 @@ const kbd = tv({ extend: tv(theme), ...(appConfig.ui?.kbd || {}) })
|
||||
|
||||
type KbdVariants = VariantProps<typeof kbd>
|
||||
|
||||
export interface KbdProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||
export interface KbdProps {
|
||||
/**
|
||||
* The element or component this component should render as.
|
||||
* @defaultValue 'kbd'
|
||||
*/
|
||||
as?: any
|
||||
value: KbdKey | string
|
||||
color?: KbdVariants['color']
|
||||
size?: KbdVariants['size']
|
||||
@@ -28,7 +32,9 @@ export interface KbdSlots {
|
||||
import { Primitive } from 'radix-vue'
|
||||
import { useKbd } from '#imports'
|
||||
|
||||
const props = withDefaults(defineProps<KbdProps>(), { as: 'kbd' })
|
||||
const props = withDefaults(defineProps<KbdProps>(), {
|
||||
as: 'kbd'
|
||||
})
|
||||
defineSlots<KbdSlots>()
|
||||
|
||||
const { getKbdKey } = useKbd()
|
||||
|
||||
Reference in New Issue
Block a user