-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add command palette * fix: add command empty --------- Co-authored-by: zernonia <[email protected]>
- Loading branch information
1 parent
d5bb3a8
commit cc49dd5
Showing
4 changed files
with
155 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import { cva } from 'class-variance-authority' | ||
import { computed } from 'vue' | ||
interface KbdProps { | ||
as?: string | ||
size?: 'xs' | 'sm' | 'md' | ||
} | ||
const props = withDefaults(defineProps<KbdProps>(), { | ||
as: 'kbd', | ||
size: 'sm', | ||
}) | ||
const kbdClass = computed(() => { | ||
return cva( | ||
'inline-flex items-center pointer-events-none h-5 select-none items-center gap-1 rounded border border-border bg-muted font-sans font-medium', | ||
{ | ||
variants: { | ||
size: { | ||
xs: 'min-h-[16px] text-[10px] h-4 px-1', | ||
sm: 'min-h-[20px] text-[11px] h-5 px-1', | ||
md: 'min-h-[24px] text-[12px] h-6 px-1.5', | ||
}, | ||
}, | ||
}, | ||
)({ | ||
size: props.size, | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<component :is="props.as" :class="kbdClass"> | ||
<slot /> | ||
</component> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters