feat(DropdownMenu): new component (#37)

This commit is contained in:
Benjamin Canac
2024-03-29 13:42:02 +01:00
committed by GitHub
parent 2fbf47e1fc
commit 44033508a7
25 changed files with 735 additions and 215 deletions

View File

@@ -17,7 +17,7 @@ export interface TabsItem {
content?: string
}
export interface TabsProps<T extends TabsItem> extends Omit<TabsRootProps, 'asChild'> {
export interface TabsProps<T> extends Omit<TabsRootProps, 'asChild'> {
items?: T[]
class?: any
ui?: Partial<typeof tabs.slots>
@@ -27,11 +27,10 @@ export interface TabsEmits extends TabsRootEmits {}
type SlotProps<T> = (props: { item: T, index: number }) => any
export type TabsSlots<T extends TabsItem> = {
export type TabsSlots<T> = {
default: SlotProps<T>
content: SlotProps<T>
} & {
[key in T['slot'] as string]?: SlotProps<T>
[key: string]: SlotProps<T>
}
</script>