fix(components): improve generic types (#3331)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Sandro Circi
2025-03-24 21:38:13 +01:00
committed by GitHub
parent 370054b20c
commit b9983549a4
106 changed files with 1203 additions and 535 deletions

View File

@@ -30,6 +30,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:
@@ -58,6 +60,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:
@@ -87,6 +91,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:
@@ -115,6 +121,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:
@@ -149,6 +157,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:
@@ -182,6 +192,8 @@ ignore:
- items
external:
- items
externalTypes:
- AccordionItem[]
hide:
- class
props:

View File

@@ -27,6 +27,8 @@ ignore:
- items
external:
- items
externalTypes:
- BreadcrumbItem[]
props:
items:
- label: 'Home'
@@ -54,6 +56,8 @@ ignore:
- items
external:
- items
externalTypes:
- BreadcrumbItem[]
props:
separatorIcon: 'i-lucide-arrow-right'
items:

View File

@@ -44,6 +44,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- ContextMenuItem[][]
props:
items:
- - label: Appearance
@@ -124,6 +126,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- ContextMenuItem[]
props:
size: xl
items:
@@ -158,6 +162,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- ContextMenuItem[]
props:
disabled: true
items:

View File

@@ -44,6 +44,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- DropdownMenuItem[][]
props:
items:
- - label: Benjamin
@@ -123,6 +125,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- DropdownMenuItem[]
items:
content.align:
- start
@@ -169,6 +173,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- DropdownMenuItem[]
props:
arrow: true
items:
@@ -202,6 +208,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- DropdownMenuItem[]
props:
size: xl
items:
@@ -244,6 +252,8 @@ ignore:
- ui.content
external:
- items
externalTypes:
- DropdownMenuItem[]
props:
disabled: true
items:
@@ -334,7 +344,9 @@ Inside the `defineShortcuts` composable, there is an `extractShortcuts` utility
```vue
<script setup lang="ts">
const items = [{
import type { DropdownMenuItem } from '@nuxt/ui'
const items: DropdownMenuItem[] = [{
label: 'Invite users',
icon: 'i-lucide-user-plus',
children: [{

View File

@@ -39,6 +39,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[]
props:
items:
- label: Guide
@@ -148,6 +150,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[][]
props:
orientation: 'vertical'
items:
@@ -247,6 +251,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[][]
props:
highlight: true
highlightColor: 'primary'
@@ -346,6 +352,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[][]
props:
color: neutral
items:
@@ -379,6 +387,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[][]
props:
color: neutral
variant: link
@@ -423,6 +433,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[]
props:
trailingIcon: 'i-lucide-arrow-down'
items:
@@ -519,6 +531,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[]
props:
arrow: true
items:
@@ -611,6 +625,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[]
props:
arrow: true
contentOrientation: 'vertical'
@@ -682,6 +698,8 @@ ignore:
- class
external:
- items
externalTypes:
- NavigationMenuItem[]
props:
unmountOnHide: false
items:

View File

@@ -28,6 +28,9 @@ ignore:
external:
- items
- modelValue
externalTypes:
- RadioGroupItem[]
- RadioGroupValue
props:
modelValue: 'System'
items:
@@ -52,6 +55,9 @@ ignore:
external:
- items
- modelValue
externalTypes:
- RadioGroupItem[]
- RadioGroupValue
props:
modelValue: 'system'
items:
@@ -84,6 +90,9 @@ ignore:
external:
- items
- modelValue
externalTypes:
- RadioGroupItem[]
- RadioGroupValue
props:
modelValue: 'light'
valueKey: 'id'
@@ -112,6 +121,8 @@ ignore:
- items
external:
- items
externalTypes:
- RadioGroupItem[]
props:
legend: 'Theme'
defaultValue: 'System'
@@ -134,6 +145,8 @@ ignore:
- items
external:
- items
externalTypes:
- RadioGroupItem[]
props:
orientation: 'horizontal'
defaultValue: 'System'
@@ -156,6 +169,8 @@ ignore:
- items
external:
- items
externalTypes:
- RadioGroupItem[]
props:
color: neutral
defaultValue: 'System'
@@ -178,6 +193,8 @@ ignore:
- items
external:
- items
externalTypes:
- RadioGroupItem[]
props:
size: 'xl'
defaultValue: 'System'
@@ -200,6 +217,8 @@ ignore:
- items
external:
- items
externalTypes:
- RadioGroupItem[]
props:
disabled: true
defaultValue: 'System'

View File

@@ -31,6 +31,8 @@ ignore:
- class
external:
- items
externalTypes:
- StepperItem[]
props:
items:
- title: 'Address'
@@ -61,6 +63,8 @@ ignore:
- class
external:
- items
externalTypes:
- StepperItem[]
props:
color: neutral
items:
@@ -88,6 +92,8 @@ ignore:
- class
external:
- items
externalTypes:
- StepperItem[]
props:
size: xl
items:
@@ -115,6 +121,8 @@ ignore:
- class
external:
- items
externalTypes:
- StepperItem[]
props:
orientation: vertical
items:
@@ -142,6 +150,8 @@ ignore:
- class
external:
- items
externalTypes:
- StepperItem[]
props:
disabled: true
items:

View File

@@ -31,6 +31,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
items:
- label: Account
@@ -55,6 +57,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
content: false
items:
@@ -80,6 +84,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
unmountOnHide: false
items:
@@ -109,6 +115,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
color: neutral
content: false
@@ -131,6 +139,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
color: neutral
variant: link
@@ -154,6 +164,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
size: md
variant: pill
@@ -177,6 +189,8 @@ ignore:
- class
external:
- items
externalTypes:
- TabsItem[]
props:
orientation: vertical
variant: pill