mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 06:51:46 +01:00
feat(Kbd): add color prop
This commit is contained in:
@@ -13,6 +13,7 @@ type KbdVariants = VariantProps<typeof kbd>
|
||||
|
||||
export interface KbdProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||
value?: string
|
||||
color?: KbdVariants['color']
|
||||
size?: KbdVariants['size']
|
||||
class?: any
|
||||
}
|
||||
@@ -30,7 +31,7 @@ defineSlots<KbdSlots>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Primitive :as="as" :class="kbd({ size, class: props.class })">
|
||||
<Primitive :as="as" :class="kbd({ color, size, class: props.class })">
|
||||
<slot>
|
||||
{{ value }}
|
||||
</slot>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
export default {
|
||||
base: 'inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-medium font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset',
|
||||
base: 'inline-flex items-center justify-center px-1 rounded font-medium font-sans',
|
||||
variants: {
|
||||
color: {
|
||||
white: 'bg-white dark:bg-gray-900 text-gray-900 dark:text-white ring ring-inset ring-gray-300 dark:ring-gray-700',
|
||||
gray: 'bg-gray-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 ring ring-inset ring-gray-300 dark:ring-gray-700',
|
||||
black: 'bg-gray-900 dark:bg-white text-white dark:text-gray-900'
|
||||
},
|
||||
size: {
|
||||
xs: 'h-4 min-w-[16px] text-[10px]',
|
||||
sm: 'h-5 min-w-[20px] text-[11px]',
|
||||
@@ -8,6 +13,7 @@ export default {
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
color: 'white',
|
||||
size: 'sm'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user