feat(CommandPalette): new component (#80)

This commit is contained in:
Benjamin Canac
2024-04-30 18:14:18 +02:00
committed by GitHub
parent 559a8cba58
commit d0017bf847
30 changed files with 1832 additions and 125 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { tv } from 'tailwind-variants'
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps } from 'radix-vue'
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps, DropdownMenuTriggerProps } from 'radix-vue'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
import theme from '#build/ui/dropdown-menu'
@@ -19,19 +19,18 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type'> {
kbds?: KbdProps['value'][] | KbdProps[]
/**
* The item type.
* @defaultValue "link"
* @defaultValue `'link'`
*/
type?: 'label' | 'separator' | 'link'
slot?: string
open?: boolean
defaultOpen?: boolean
select? (e: Event): void
children?: DropdownMenuItem[] | DropdownMenuItem[][]
select? (e: Event): void
}
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'> {
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>, Pick<DropdownMenuTriggerProps, 'disabled'> {
items?: T[] | T[][]
disabled?: boolean
content?: Omit<DropdownMenuContentProps, 'asChild' | 'forceMount'>
arrow?: boolean | Omit<DropdownMenuArrowProps, 'asChild'>
portal?: boolean