diff --git a/docs/app/components/content/ComponentExample.vue b/docs/app/components/content/ComponentExample.vue index 1d2889e63a..a681de5f6d 100644 --- a/docs/app/components/content/ComponentExample.vue +++ b/docs/app/components/content/ComponentExample.vue @@ -4,6 +4,7 @@ import { camelCase } from 'scule' import { hash } from 'ohash' import { useElementSize } from '@vueuse/core' import { get, set } from '#ui/utils' +import type { SlotsReturn } from '#ui/types/utils' const props = withDefaults(defineProps<{ name: string @@ -65,8 +66,8 @@ const props = withDefaults(defineProps<{ }) const slots = defineSlots<{ - options(props?: {}): any - code(props?: {}): any + options?(props?: {}): SlotsReturn + code?(props?: {}): SlotsReturn }>() const el = ref(null) diff --git a/docs/app/components/theme-picker/ThemePickerButton.vue b/docs/app/components/theme-picker/ThemePickerButton.vue index 8795cf891a..95759ee0d2 100644 --- a/docs/app/components/theme-picker/ThemePickerButton.vue +++ b/docs/app/components/theme-picker/ThemePickerButton.vue @@ -1,4 +1,6 @@ diff --git a/playgrounds/nuxt/app/components/Matrix.vue b/playgrounds/nuxt/app/components/Matrix.vue index c3aeb9772a..dd73e52191 100644 --- a/playgrounds/nuxt/app/components/Matrix.vue +++ b/playgrounds/nuxt/app/components/Matrix.vue @@ -1,4 +1,6 @@ diff --git a/src/runtime/components/Alert.vue b/src/runtime/components/Alert.vue index 1d9ab5c5c1..b6b36ca01d 100644 --- a/src/runtime/components/Alert.vue +++ b/src/runtime/components/Alert.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/alert' import type { AvatarProps, ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Alert = ComponentConfig @@ -61,11 +62,11 @@ export interface AlertEmits { } export interface AlertSlots { - leading(props?: {}): any - title(props?: {}): any - description(props?: {}): any - actions(props?: {}): any - close(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + close?(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn } diff --git a/src/runtime/components/App.vue b/src/runtime/components/App.vue index d2171cb9d6..d4216027f2 100644 --- a/src/runtime/components/App.vue +++ b/src/runtime/components/App.vue @@ -2,6 +2,7 @@ import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui' import type { ToasterProps } from '../types' import type { Locale, Messages } from '../types/locale' +import type { SlotsReturn } from '../types/utils' export interface AppProps extends Omit { tooltip?: TooltipProviderProps @@ -11,7 +12,7 @@ export interface AppProps extends Omit @@ -90,19 +91,19 @@ export type AuthFormEmits = { submit: [payload: FormSubmitEvent] } -type DynamicFieldSlots = Record any> & Record<`${keyof T extends string ? keyof T : never}-field`, (props: SlotProps) => any> +type DynamicFieldSlots = Record SlotsReturn> & Record<`${keyof T extends string ? keyof T : never}-field`, (props: SlotProps) => SlotsReturn> -type DynamicFormFieldSlots = Record any> & Record<`${keyof T extends string ? keyof T : never}-${'label' | 'description' | 'hint' | 'help' | 'error'}`, (props?: {}) => any> +type DynamicFormFieldSlots = Record SlotsReturn> & Record<`${keyof T extends string ? keyof T : never}-${'label' | 'description' | 'hint' | 'help' | 'error'}`, (props?: {}) => SlotsReturn> export type AuthFormSlots = { - header(props?: {}): any - leading(props?: {}): any - title(props?: {}): any - description(props?: {}): any - providers(props?: {}): any - validation(props?: {}): any - submit(props: { loading: boolean }): any - footer(props?: {}): any + header?(props?: {}): SlotsReturn + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + providers?(props?: {}): SlotsReturn + validation?(props?: {}): SlotsReturn + submit?(props: { loading: boolean }): SlotsReturn + footer?(props?: {}): SlotsReturn } & DynamicFieldSlots & DynamicFormFieldSlots diff --git a/src/runtime/components/Avatar.vue b/src/runtime/components/Avatar.vue index 8d4b1211f6..be51d419ab 100644 --- a/src/runtime/components/Avatar.vue +++ b/src/runtime/components/Avatar.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/avatar' import type { ChipProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Avatar = ComponentConfig @@ -30,7 +31,7 @@ export interface AvatarProps { } export interface AvatarSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/AvatarGroup.vue b/src/runtime/components/AvatarGroup.vue index 722d5519ae..3d65b97fa9 100644 --- a/src/runtime/components/AvatarGroup.vue +++ b/src/runtime/components/AvatarGroup.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/avatar-group' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type AvatarGroup = ComponentConfig @@ -24,7 +25,7 @@ export interface AvatarGroupProps { } export interface AvatarGroupSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } @@ -49,6 +50,9 @@ const max = computed(() => typeof props.max === 'string' ? Number.parseInt(props const children = computed(() => { let children = slots.default?.() + if (!Array.isArray(children)) { + children = children ? [children] : [] + } if (children?.length) { children = children.flatMap((child: any) => { if (typeof child.type === 'symbol') { diff --git a/src/runtime/components/Badge.vue b/src/runtime/components/Badge.vue index 6ee8a7a88e..d8b0ad40af 100644 --- a/src/runtime/components/Badge.vue +++ b/src/runtime/components/Badge.vue @@ -4,6 +4,7 @@ import theme from '#build/ui/badge' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Badge = ComponentConfig @@ -33,9 +34,9 @@ export interface BadgeProps extends Omit diff --git a/src/runtime/components/Banner.vue b/src/runtime/components/Banner.vue index ea89369361..59b32fade3 100644 --- a/src/runtime/components/Banner.vue +++ b/src/runtime/components/Banner.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/banner' import type { ButtonProps, IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Banner = ComponentConfig @@ -53,10 +54,10 @@ export interface BannerProps { } export interface BannerSlots { - leading(props?: {}): any - title(props?: {}): any - actions(props?: {}): any - close(props: { ui: any }): any + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + close?(props: { ui: any }): SlotsReturn } export interface BannerEmits { diff --git a/src/runtime/components/BlogPost.vue b/src/runtime/components/BlogPost.vue index 5b345b766d..e8561114c9 100644 --- a/src/runtime/components/BlogPost.vue +++ b/src/runtime/components/BlogPost.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/blog-post' import type { BadgeProps, LinkProps, UserProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type BlogPost = ComponentConfig @@ -43,14 +44,14 @@ export interface BlogPostProps { } export interface BlogPostSlots { - date(props?: {}): any - badge(props?: {}): any - title(props?: {}): any - description(props?: {}): any - authors(props?: {}): any - header(props?: {}): any - body(props?: {}): any - footer(props?: {}): any + date?(props?: {}): SlotsReturn + badge?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + authors?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/BlogPosts.vue b/src/runtime/components/BlogPosts.vue index de5abc5f3e..5118b8ac05 100644 --- a/src/runtime/components/BlogPosts.vue +++ b/src/runtime/components/BlogPosts.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/blog-posts' import type { BlogPostProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type BlogPosts = ComponentConfig @@ -22,7 +23,7 @@ export interface BlogPostsProps { } export interface BlogPostsSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Breadcrumb.vue b/src/runtime/components/Breadcrumb.vue index a6f9092577..c6089a4203 100644 --- a/src/runtime/components/Breadcrumb.vue +++ b/src/runtime/components/Breadcrumb.vue @@ -3,7 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/breadcrumb' import type { AvatarProps, IconProps, LinkProps } from '../types' -import type { DynamicSlots, GetItemKeys } from '../types/utils' +import type { DynamicSlots, GetItemKeys, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Breadcrumb = ComponentConfig @@ -43,14 +43,14 @@ export interface BreadcrumbProps { ui?: Breadcrumb['slots'] } -type SlotProps = (props: { item: T, index: number, active?: boolean }) => any +type SlotProps = (props: { item: T, index: number, active?: boolean }) => SlotsReturn export type BreadcrumbSlots = { - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'separator': any + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'separator'?: (props?: {}) => SlotsReturn } & DynamicSlots @@ -90,19 +90,19 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb |
  • - - + + - + {{ get(item, props.labelKey as string) }} - + diff --git a/src/runtime/components/Button.vue b/src/runtime/components/Button.vue index c0411ade3a..009269721e 100644 --- a/src/runtime/components/Button.vue +++ b/src/runtime/components/Button.vue @@ -1,9 +1,11 @@ diff --git a/src/runtime/components/Card.vue b/src/runtime/components/Card.vue index 2e53d39dcc..c8f47e67fd 100644 --- a/src/runtime/components/Card.vue +++ b/src/runtime/components/Card.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/card' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Card = ComponentConfig @@ -20,9 +21,9 @@ export interface CardProps { } export interface CardSlots { - header(props?: {}): any - default(props?: {}): any - footer(props?: {}): any + header?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Carousel.vue b/src/runtime/components/Carousel.vue index 75191d0031..c4c82d4fe7 100644 --- a/src/runtime/components/Carousel.vue +++ b/src/runtime/components/Carousel.vue @@ -10,7 +10,7 @@ import type { FadeOptionsType } from 'embla-carousel-fade' import type { WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures' import theme from '#build/ui/carousel' import type { ButtonProps, IconProps } from '../types' -import type { AcceptableValue } from '../types/utils' +import type { AcceptableValue, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Carousel = ComponentConfig @@ -101,7 +101,7 @@ export interface CarouselProps extends Om } export type CarouselSlots = { - default(props: { item: T, index: number }): any + default?(props: { item: T, index: number }): SlotsReturn } export interface CarouselEmits { diff --git a/src/runtime/components/ChangelogVersion.vue b/src/runtime/components/ChangelogVersion.vue index 75d0ca9a88..c3c38e3a41 100644 --- a/src/runtime/components/ChangelogVersion.vue +++ b/src/runtime/components/ChangelogVersion.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/changelog-version' import type { BadgeProps, LinkProps, UserProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type ChangelogVersion = ComponentConfig @@ -39,17 +40,17 @@ export interface ChangelogVersionProps { } export interface ChangelogVersionSlots { - header(props?: {}): any - badge(props?: {}): any - date(props?: {}): any - title(props?: {}): any - description(props?: {}): any - image(props?: {}): any - body(props?: {}): any - footer(props?: {}): any - authors(props?: {}): any - actions(props?: {}): any - indicator(props?: {}): any + header?(props?: {}): SlotsReturn + badge?(props?: {}): SlotsReturn + date?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + image?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + authors?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + indicator?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/ChangelogVersions.vue b/src/runtime/components/ChangelogVersions.vue index c76ac1f618..2189a96a69 100644 --- a/src/runtime/components/ChangelogVersions.vue +++ b/src/runtime/components/ChangelogVersions.vue @@ -4,6 +4,7 @@ import type { SpringOptions } from 'motion-v' import theme from '#build/ui/changelog-versions' import type { ChangelogVersionProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type ChangelogVersions = ComponentConfig @@ -31,19 +32,18 @@ export interface ChangelogVersionsProps { - default(props?: {}): any - indicator(props?: {}): any - header(props: { version: T }): any - badge(props: { version: T }): any - date(props: { version: T }): any - title(props: { version: T }): any - description(props: { version: T }): any - image(props: { version: T }): any - body(props: { version: T }): any - footer(props: { version: T }): any - authors(props: { version: T }): any - actions(props: { version: T }): any - indicator(props: { version: T }): any + default?(props?: {}): SlotsReturn + indicator?(props?: {}): SlotsReturn + header?(props: { version: T }): SlotsReturn + badge?(props: { version: T }): SlotsReturn + date?(props: { version: T }): SlotsReturn + title?(props: { version: T }): SlotsReturn + description?(props: { version: T }): SlotsReturn + image?(props: { version: T }): SlotsReturn + body?(props: { version: T }): SlotsReturn + footer?(props: { version: T }): SlotsReturn + authors?(props: { version: T }): SlotsReturn + actions?(props: { version: T }): SlotsReturn } diff --git a/src/runtime/components/ChatMessage.vue b/src/runtime/components/ChatMessage.vue index 04f54cc44a..725e4c2212 100644 --- a/src/runtime/components/ChatMessage.vue +++ b/src/runtime/components/ChatMessage.vue @@ -4,6 +4,7 @@ import type { UIMessage } from 'ai' import theme from '#build/ui/chat-message' import type { AvatarProps, ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type ChatMessage = ComponentConfig @@ -48,9 +49,9 @@ export interface ChatMessageProps extends UIMessage { } export interface ChatMessageSlots { - leading(props: { avatar: ChatMessageProps['avatar'] }): any - content(props: ChatMessageProps): any - actions(props: { actions: ChatMessageProps['actions'] }): any + leading?(props: { avatar: ChatMessageProps['avatar'] }): SlotsReturn + content?(props: ChatMessageProps): SlotsReturn + actions?(props: { actions: ChatMessageProps['actions'] }): SlotsReturn } diff --git a/src/runtime/components/ChatMessages.vue b/src/runtime/components/ChatMessages.vue index c19740d389..f5f8d0399e 100644 --- a/src/runtime/components/ChatMessages.vue +++ b/src/runtime/components/ChatMessages.vue @@ -1,9 +1,11 @@ diff --git a/src/runtime/components/ChatPrompt.vue b/src/runtime/components/ChatPrompt.vue index 89ff553c80..f16dba030c 100644 --- a/src/runtime/components/ChatPrompt.vue +++ b/src/runtime/components/ChatPrompt.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/chat-prompt' import type { TextareaProps, TextareaSlots } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type ChatPrompt = ComponentConfig @@ -35,8 +36,8 @@ export interface ChatPromptEmits { } export interface ChatPromptSlots extends TextareaSlots { - header(props?: {}): any - footer(props?: {}): any + header?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Checkbox.vue b/src/runtime/components/Checkbox.vue index 1c6884ef0f..78b86536a0 100644 --- a/src/runtime/components/Checkbox.vue +++ b/src/runtime/components/Checkbox.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/checkbox' import type { IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Checkbox = ComponentConfig @@ -53,8 +54,8 @@ export type CheckboxEmits = { } export interface CheckboxSlots { - label(props: { label?: string }): any - description(props: { description?: string }): any + label?(props: { label?: string }): SlotsReturn + description?(props: { description?: string }): SlotsReturn } diff --git a/src/runtime/components/CheckboxGroup.vue b/src/runtime/components/CheckboxGroup.vue index d89586a815..dd820d245d 100644 --- a/src/runtime/components/CheckboxGroup.vue +++ b/src/runtime/components/CheckboxGroup.vue @@ -3,7 +3,7 @@ import type { CheckboxGroupRootProps, CheckboxGroupRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/checkbox-group' import type { CheckboxProps } from '../types' -import type { AcceptableValue, GetItemKeys, GetModelValue } from '../types/utils' +import type { AcceptableValue, GetItemKeys, GetModelValue, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type CheckboxGroup = ComponentConfig @@ -67,12 +67,12 @@ export type CheckboxGroupEmits = (props: { item: T & { id: string } }) => any +type SlotProps = (props: { item: T & { id: string } }) => SlotsReturn export interface CheckboxGroupSlots { - legend(props?: {}): any - label: SlotProps - description: SlotProps + legend?(props?: {}): SlotsReturn + label?: SlotProps + description?: SlotProps } diff --git a/src/runtime/components/Chip.vue b/src/runtime/components/Chip.vue index 742c2ecaf8..6ce4015947 100644 --- a/src/runtime/components/Chip.vue +++ b/src/runtime/components/Chip.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/chip' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Chip = ComponentConfig @@ -39,8 +40,8 @@ export interface ChipEmits { } export interface ChipSlots { - default(props?: {}): any - content(props?: {}): any + default?(props?: {}): SlotsReturn + content?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Collapsible.vue b/src/runtime/components/Collapsible.vue index 6bf0703c32..14ceeaa0c9 100644 --- a/src/runtime/components/Collapsible.vue +++ b/src/runtime/components/Collapsible.vue @@ -3,6 +3,7 @@ import type { CollapsibleRootProps, CollapsibleRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/collapsible' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Collapsible = ComponentConfig @@ -19,8 +20,8 @@ export interface CollapsibleProps extends Pick diff --git a/src/runtime/components/CommandPalette.vue b/src/runtime/components/CommandPalette.vue index 0a213df0a2..8ee25a3341 100644 --- a/src/runtime/components/CommandPalette.vue +++ b/src/runtime/components/CommandPalette.vue @@ -7,7 +7,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse' import theme from '#build/ui/command-palette' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps, LinkProps, IconProps } from '../types' -import type { GetItemKeys } from '../types/utils' +import type { GetItemKeys, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type CommandPalette = ComponentConfig @@ -161,17 +161,17 @@ export type CommandPaletteEmits = (props: { item: T, index: number }) => any +type SlotProps = (props: { item: T, index: number }) => SlotsReturn export type CommandPaletteSlots = CommandPaletteGroup, T extends CommandPaletteItem = CommandPaletteItem> = { - 'empty'(props: { searchTerm?: string }): any - 'footer'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any - 'back'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any - 'close'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps + 'empty'?(props: { searchTerm?: string }): SlotsReturn + 'footer'?(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn + 'back'?(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn + 'close'?(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps } & Record> & Record> diff --git a/src/runtime/components/Container.vue b/src/runtime/components/Container.vue index cda21f8f41..e14b97733e 100644 --- a/src/runtime/components/Container.vue +++ b/src/runtime/components/Container.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/container' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Container = ComponentConfig @@ -15,7 +16,7 @@ export interface ContainerProps { } export interface ContainerSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/ContextMenu.vue b/src/runtime/components/ContextMenu.vue index 208e548dfd..f8fcb9ae40 100644 --- a/src/runtime/components/ContextMenu.vue +++ b/src/runtime/components/ContextMenu.vue @@ -4,7 +4,7 @@ import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProp import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/context-menu' import type { AvatarProps, IconProps, KbdProps, LinkProps } from '../types' -import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps } from '../types/utils' +import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type ContextMenu = ComponentConfig @@ -82,19 +82,19 @@ export interface ContextMenuProps = Arr export interface ContextMenuEmits extends ContextMenuRootEmits {} -type SlotProps = (props: { item: T, active?: boolean, index: number }) => any +type SlotProps = (props: { item: T, active?: boolean, index: number }) => SlotsReturn export type ContextMenuSlots< A extends ArrayOrNested = ArrayOrNested, T extends NestedItem = NestedItem > = { - 'default'(props?: {}): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'content-top': (props?: {}) => any - 'content-bottom': (props?: {}) => any + 'default'?(props?: {}): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'content-top'?: (props?: {}) => SlotsReturn + 'content-bottom'?: (props?: {}) => SlotsReturn } & DynamicSlots, 'leading' | 'label' | 'trailing', { active?: boolean, index: number }> diff --git a/src/runtime/components/DashboardGroup.vue b/src/runtime/components/DashboardGroup.vue index 11f0d27b2d..7dd9f9afb8 100644 --- a/src/runtime/components/DashboardGroup.vue +++ b/src/runtime/components/DashboardGroup.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/dashboard-group' import type { UseResizableProps } from '../composables/useResizable' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardGroup = ComponentConfig @@ -16,7 +17,7 @@ export interface DashboardGroupProps extends Pick diff --git a/src/runtime/components/DashboardNavbar.vue b/src/runtime/components/DashboardNavbar.vue index f8109c2621..79fb77c0ce 100644 --- a/src/runtime/components/DashboardNavbar.vue +++ b/src/runtime/components/DashboardNavbar.vue @@ -4,6 +4,7 @@ import theme from '#build/ui/dashboard-navbar' import type { DashboardContext } from '../utils/dashboard' import type { ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardNavbar = ComponentConfig @@ -37,13 +38,13 @@ export interface DashboardNavbarProps { type DashboardNavbarSlotsProps = Omit export interface DashboardNavbarSlots { - title(props?: {}): any - leading(props: DashboardNavbarSlotsProps): any - trailing(props: DashboardNavbarSlotsProps): any - left(props: DashboardNavbarSlotsProps): any - default(props: DashboardNavbarSlotsProps): any - right(props: DashboardNavbarSlotsProps): any - toggle(props: DashboardNavbarSlotsProps): any + title?(props?: {}): SlotsReturn + leading?(props: DashboardNavbarSlotsProps): SlotsReturn + trailing?(props: DashboardNavbarSlotsProps): SlotsReturn + left?(props: DashboardNavbarSlotsProps): SlotsReturn + default?(props: DashboardNavbarSlotsProps): SlotsReturn + right?(props: DashboardNavbarSlotsProps): SlotsReturn + toggle?(props: DashboardNavbarSlotsProps): SlotsReturn } diff --git a/src/runtime/components/DashboardPanel.vue b/src/runtime/components/DashboardPanel.vue index 2aed4b7620..1ef53d3bb0 100644 --- a/src/runtime/components/DashboardPanel.vue +++ b/src/runtime/components/DashboardPanel.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/dashboard-panel' import type { UseResizableProps } from '../composables/useResizable' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardPanel = ComponentConfig @@ -12,11 +13,11 @@ export interface DashboardPanelProps extends Pick void, onTouchStart: (e: TouchEvent) => void, onDoubleClick: (e: MouseEvent) => void }): any + 'default'?(props?: {}): SlotsReturn + 'header'?(props?: {}): SlotsReturn + 'body'?(props?: {}): SlotsReturn + 'footer'?(props?: {}): SlotsReturn + 'resize-handle'?(props: { onMouseDown: (e: MouseEvent) => void, onTouchStart: (e: TouchEvent) => void, onDoubleClick: (e: MouseEvent) => void }): SlotsReturn } diff --git a/src/runtime/components/DashboardResizeHandle.vue b/src/runtime/components/DashboardResizeHandle.vue index a909b90c1d..949f2e39d5 100644 --- a/src/runtime/components/DashboardResizeHandle.vue +++ b/src/runtime/components/DashboardResizeHandle.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/dashboard-resize-handle' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardResizeHandle = ComponentConfig @@ -15,7 +16,7 @@ export interface DashboardResizeHandleProps { } export interface DashboardResizeHandleSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/DashboardSearch.vue b/src/runtime/components/DashboardSearch.vue index cc836edf67..2b7d9f651d 100644 --- a/src/runtime/components/DashboardSearch.vue +++ b/src/runtime/components/DashboardSearch.vue @@ -5,6 +5,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse' import theme from '#build/ui/dashboard-search' import type { ButtonProps, InputProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardSearch = ComponentConfig @@ -67,7 +68,7 @@ export interface DashboardSearchProps, CommandPaletteItem> & { - content(props?: {}): any + content?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/DashboardSidebar.vue b/src/runtime/components/DashboardSidebar.vue index 6b01e9ad5e..3faee71557 100644 --- a/src/runtime/components/DashboardSidebar.vue +++ b/src/runtime/components/DashboardSidebar.vue @@ -4,6 +4,7 @@ import theme from '#build/ui/dashboard-sidebar' import type { UseResizableProps } from '../composables/useResizable' import type { ButtonProps, DrawerProps, ModalProps, SlideoverProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardSidebar = ComponentConfig @@ -36,12 +37,12 @@ export interface DashboardSidebarProps void }): any - 'default'(props: { collapsed?: boolean, collapse?: (value: boolean) => void }): any - 'footer'(props: { collapsed?: boolean, collapse?: (value: boolean) => void }): any - 'toggle'(props: { open: boolean, toggle: () => void }): any - 'content'(props?: {}): any - 'resize-handle'(props: { onMouseDown: (e: MouseEvent) => void, onTouchStart: (e: TouchEvent) => void, onDoubleClick: (e: MouseEvent) => void }): any + 'header'?(props: { collapsed?: boolean, collapse?: (value: boolean) => void }): SlotsReturn + 'default'?(props: { collapsed?: boolean, collapse?: (value: boolean) => void }): SlotsReturn + 'footer'?(props: { collapsed?: boolean, collapse?: (value: boolean) => void }): SlotsReturn + 'toggle'?(props: { open: boolean, toggle: () => void }): SlotsReturn + 'content'?(props?: {}): SlotsReturn + 'resize-handle'?(props: { onMouseDown: (e: MouseEvent) => void, onTouchStart: (e: TouchEvent) => void, onDoubleClick: (e: MouseEvent) => void }): SlotsReturn } diff --git a/src/runtime/components/DashboardToolbar.vue b/src/runtime/components/DashboardToolbar.vue index 0804190641..40d73e9a83 100644 --- a/src/runtime/components/DashboardToolbar.vue +++ b/src/runtime/components/DashboardToolbar.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/dashboard-toolbar' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type DashboardToolbar = ComponentConfig @@ -16,9 +17,9 @@ export interface DashboardToolbarProps { } export interface DashboardToolbarSlots { - default(props?: {}): any - left(props?: {}): any - right(props?: {}): any + default?(props?: {}): SlotsReturn + left?(props?: {}): SlotsReturn + right?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Drawer.vue b/src/runtime/components/Drawer.vue index 65e92871eb..3aa0507a81 100644 --- a/src/runtime/components/Drawer.vue +++ b/src/runtime/components/Drawer.vue @@ -3,7 +3,7 @@ import type { DrawerRootProps, DrawerRootEmits } from 'vaul-vue' import type { DialogContentProps, DialogContentEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/drawer' -import type { EmitsToProps } from '../types/utils' +import type { EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Drawer = ComponentConfig @@ -52,13 +52,13 @@ export interface DrawerEmits extends DrawerRootEmits { } export interface DrawerSlots { - default(props?: {}): any - content(props?: {}): any - header(props?: {}): any - title(props?: {}): any - description(props?: {}): any - body(props?: {}): any - footer(props?: {}): any + default?(props?: {}): SlotsReturn + content?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/DropdownMenu.vue b/src/runtime/components/DropdownMenu.vue index 5eb96481c1..331bc9293f 100644 --- a/src/runtime/components/DropdownMenu.vue +++ b/src/runtime/components/DropdownMenu.vue @@ -4,7 +4,7 @@ import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentP import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/dropdown-menu' import type { AvatarProps, IconProps, KbdProps, LinkProps } from '../types' -import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps } from '../types/utils' +import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type DropdownMenu = ComponentConfig @@ -90,19 +90,19 @@ export interface DropdownMenuProps = A export interface DropdownMenuEmits extends DropdownMenuRootEmits {} -type SlotProps = (props: { item: T, active?: boolean, index: number }) => any +type SlotProps = (props: { item: T, active?: boolean, index: number }) => SlotsReturn export type DropdownMenuSlots< A extends ArrayOrNested = ArrayOrNested, T extends NestedItem = NestedItem > = { - 'default'(props: { open: boolean }): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'content-top': (props?: {}) => any - 'content-bottom': (props?: {}) => any + 'default'?(props: { open: boolean }): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'content-top'?: (props?: {}) => SlotsReturn + 'content-bottom'?: (props?: {}) => SlotsReturn } & DynamicSlots, 'leading' | 'label' | 'trailing', { active?: boolean, index: number }> diff --git a/src/runtime/components/DropdownMenuContent.vue b/src/runtime/components/DropdownMenuContent.vue index bfcbd56016..d1ef946699 100644 --- a/src/runtime/components/DropdownMenuContent.vue +++ b/src/runtime/components/DropdownMenuContent.vue @@ -4,7 +4,7 @@ import type { DropdownMenuContentProps as RekaDropdownMenuContentProps, Dropdown import type { AppConfig } from '@nuxt/schema' import type theme from '#build/ui/dropdown-menu' import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots, IconProps } from '../types' -import type { ArrayOrNested, GetItemKeys, NestedItem, DynamicSlots, MergeTypes } from '../types/utils' +import type { ArrayOrNested, GetItemKeys, NestedItem, DynamicSlots, MergeTypes, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type DropdownMenu = ComponentConfig @@ -37,7 +37,7 @@ type DropdownMenuContentSlots< A extends ArrayOrNested = ArrayOrNested, T extends NestedItem = NestedItem > = Pick, 'item' | 'item-leading' | 'item-label' | 'item-trailing' | 'content-top' | 'content-bottom'> & { - default(props?: {}): any + default?(props?: {}): SlotsReturn } & DynamicSlots, 'leading' | 'label' | 'trailing', { active?: boolean, index: number }> diff --git a/src/runtime/components/Empty.vue b/src/runtime/components/Empty.vue index fde3dea1a1..9441a113c8 100644 --- a/src/runtime/components/Empty.vue +++ b/src/runtime/components/Empty.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/empty' import type { ComponentConfig } from '../types/tv' import type { ButtonProps, IconProps, AvatarProps } from '../types' +import type { SlotsReturn } from '../types/utils' type Empty = ComponentConfig @@ -37,13 +38,13 @@ export interface EmptyProps { } export interface EmptySlots { - header(props?: {}): any - leading(props?: {}): any - title(props?: {}): any - description(props?: {}): any - body(props?: {}): any - actions(props?: {}): any - footer(props?: {}): any + header?(props?: {}): SlotsReturn + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Error.vue b/src/runtime/components/Error.vue index 66fedb6c44..0d2453d2e2 100644 --- a/src/runtime/components/Error.vue +++ b/src/runtime/components/Error.vue @@ -4,6 +4,7 @@ import type { NuxtError } from '#app' import theme from '#build/ui/error' import type { ButtonProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Error = ComponentConfig @@ -30,11 +31,11 @@ export interface ErrorProps { } export interface ErrorSlots { - default(props?: {}): any - statusCode(props?: {}): any - statusMessage(props?: {}): any - message(props?: {}): any - links(props?: {}): any + default?(props?: {}): SlotsReturn + statusCode?(props?: {}): SlotsReturn + statusMessage?(props?: {}): SlotsReturn + message?(props?: {}): SlotsReturn + links?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/FieldGroup.vue b/src/runtime/components/FieldGroup.vue index 3bb45f90e7..9564e736c7 100644 --- a/src/runtime/components/FieldGroup.vue +++ b/src/runtime/components/FieldGroup.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/field-group' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type FieldGroup = ComponentConfig @@ -25,7 +26,7 @@ export interface FieldGroupProps { } export interface FieldGroupSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/FileUpload.vue b/src/runtime/components/FileUpload.vue index 17b9a8b3f3..2e40db3780 100644 --- a/src/runtime/components/FileUpload.vue +++ b/src/runtime/components/FileUpload.vue @@ -4,6 +4,7 @@ import type { UseFileDialogReturn } from '@vueuse/core' import theme from '#build/ui/file-upload' import type { ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type FileUpload = ComponentConfig @@ -103,22 +104,22 @@ export interface FileUploadEmits { type FileUploadFiles = (M extends true ? File[] : File) | null export interface FileUploadSlots { - 'default'(props: { + 'default'?(props: { open: UseFileDialogReturn['open'] removeFile: (index?: number) => void - }): any - 'leading'(props?: {}): any - 'label'(props?: {}): any - 'description'(props?: {}): any - 'actions'(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): any - 'files'(props: { files?: FileUploadFiles }): any - 'files-top'(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): any - 'files-bottom'(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): any - 'file'(props: { file: File, index: number }): any - 'file-leading'(props: { file: File, index: number }): any - 'file-name'(props: { file: File, index: number }): any - 'file-size'(props: { file: File, index: number }): any - 'file-trailing'(props: { file: File, index: number }): any + }): SlotsReturn + 'leading'?(props?: {}): SlotsReturn + 'label'?(props?: {}): SlotsReturn + 'description'?(props?: {}): SlotsReturn + 'actions'?(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): SlotsReturn + 'files'?(props: { files?: FileUploadFiles }): SlotsReturn + 'files-top'?(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): SlotsReturn + 'files-bottom'?(props: { files?: FileUploadFiles, open: UseFileDialogReturn['open'], removeFile: (index?: number) => void }): SlotsReturn + 'file'?(props: { file: File, index: number }): SlotsReturn + 'file-leading'?(props: { file: File, index: number }): SlotsReturn + 'file-name'?(props: { file: File, index: number }): SlotsReturn + 'file-size'?(props: { file: File, index: number }): SlotsReturn + 'file-trailing'?(props: { file: File, index: number }): SlotsReturn } diff --git a/src/runtime/components/Footer.vue b/src/runtime/components/Footer.vue index eae721f362..6f46212cf9 100644 --- a/src/runtime/components/Footer.vue +++ b/src/runtime/components/Footer.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/FooterColumns.vue b/src/runtime/components/FooterColumns.vue index 5857cb8c7d..52311b96d4 100644 --- a/src/runtime/components/FooterColumns.vue +++ b/src/runtime/components/FooterColumns.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/footer-columns' import type { IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type FooterColumns = ComponentConfig @@ -32,17 +33,17 @@ export interface FooterColumnsProps = (props: { link: T, active: boolean }) => any +type SlotProps = (props: { link: T, active: boolean }) => SlotsReturn export interface FooterColumnsSlots { - 'left'(props?: {}): any - 'default'(props?: {}): any - 'right'(props?: {}): any - 'column-label'?: (props: { column: FooterColumn }) => any - 'link': SlotProps - 'link-leading': SlotProps - 'link-label': SlotProps - 'link-trailing': SlotProps + 'left'?(props?: {}): SlotsReturn + 'default'?(props?: {}): SlotsReturn + 'right'?(props?: {}): SlotsReturn + 'column-label'?: (props: { column: FooterColumn }) => SlotsReturn + 'link'?: SlotProps + 'link-leading'?: SlotProps + 'link-label'?: SlotProps + 'link-trailing'?: SlotProps } diff --git a/src/runtime/components/Form.vue b/src/runtime/components/Form.vue index 653900c4a1..79a2d43b88 100644 --- a/src/runtime/components/Form.vue +++ b/src/runtime/components/Form.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/form' import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId, InferInput, InferOutput, FormData } from '../types/form' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type FormConfig = ComponentConfig @@ -68,7 +69,7 @@ export interface FormEmits { } export interface FormSlots { - default(props: { errors: FormError[], loading: boolean }): any + default(props: { errors: FormError[], loading: boolean }): SlotsReturn } diff --git a/src/runtime/components/FormField.vue b/src/runtime/components/FormField.vue index 87e523d996..696d636534 100644 --- a/src/runtime/components/FormField.vue +++ b/src/runtime/components/FormField.vue @@ -1,7 +1,9 @@ diff --git a/src/runtime/components/Input.vue b/src/runtime/components/Input.vue index aed1b12f1d..293df4b4b0 100644 --- a/src/runtime/components/Input.vue +++ b/src/runtime/components/Input.vue @@ -5,7 +5,7 @@ import theme from '#build/ui/input' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps } from '../types' import type { ModelModifiers } from '../types/input' -import type { AcceptableValue } from '../types/utils' +import type { AcceptableValue, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Input = ComponentConfig @@ -55,9 +55,9 @@ export interface InputEmits { } export interface InputSlots { - leading(props?: {}): any - default(props?: {}): any - trailing(props?: {}): any + leading?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn + trailing?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/InputMenu.vue b/src/runtime/components/InputMenu.vue index cb6af99f8f..30cab51c97 100644 --- a/src/runtime/components/InputMenu.vue +++ b/src/runtime/components/InputMenu.vue @@ -5,7 +5,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/input-menu' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps, ChipProps, IconProps, InputProps } from '../types' -import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps } from '../types/utils' +import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type InputMenu = ComponentConfig @@ -158,7 +158,7 @@ export type InputMenuEmits, VK extends Ge 'remove-tag': [item: GetModelValue] } & GetModelValueEmits -type SlotProps = (props: { item: T, index: number }) => any +type SlotProps = (props: { item: T, index: number }) => SlotsReturn export interface InputMenuSlots< A extends ArrayOrNested = ArrayOrNested, @@ -166,26 +166,26 @@ export interface InputMenuSlots< M extends boolean = false, T extends NestedItem = NestedItem > { - 'leading'(props: { + 'leading'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'trailing'(props: { + }): SlotsReturn + 'trailing'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'empty'(props: { searchTerm?: string }): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'tags-item-text': SlotProps - 'tags-item-delete': SlotProps - 'content-top': (props?: {}) => any - 'content-bottom': (props?: {}) => any - 'create-item-label'(props: { item: string }): any + }): SlotsReturn + 'empty'?(props: { searchTerm?: string }): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'tags-item-text'?: SlotProps + 'tags-item-delete'?: SlotProps + 'content-top'?: (props?: {}) => SlotsReturn + 'content-bottom'?: (props?: {}) => SlotsReturn + 'create-item-label'?(props: { item: string }): SlotsReturn } diff --git a/src/runtime/components/InputNumber.vue b/src/runtime/components/InputNumber.vue index a865e9e039..3175a20090 100644 --- a/src/runtime/components/InputNumber.vue +++ b/src/runtime/components/InputNumber.vue @@ -5,6 +5,7 @@ import theme from '#build/ui/input-number' import type { ButtonProps, IconProps } from '../types' import type { ModelModifiers } from '../types/input' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type InputNumber = ComponentConfig @@ -71,8 +72,8 @@ export interface InputNumberEmits { } export interface InputNumberSlots { - increment(props?: {}): any - decrement(props?: {}): any + increment?(props?: {}): SlotsReturn + decrement?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/InputTags.vue b/src/runtime/components/InputTags.vue index a55e664de7..c03fd5b276 100644 --- a/src/runtime/components/InputTags.vue +++ b/src/runtime/components/InputTags.vue @@ -5,6 +5,7 @@ import theme from '#build/ui/input-tags' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type InputTags = ComponentConfig @@ -52,14 +53,14 @@ export interface InputTagsEmits extends TagsInputRootEmi focus: [event: FocusEvent] } -type SlotProps = (props: { item: T, index: number }) => any +type SlotProps = (props: { item: T, index: number }) => SlotsReturn export interface InputTagsSlots { - 'leading'(props?: {}): any - 'default'(props?: {}): any - 'trailing'(props?: {}): any - 'item-text': SlotProps - 'item-delete': SlotProps + 'leading'?(props?: {}): SlotsReturn + 'default'?(props?: {}): SlotsReturn + 'trailing'?(props?: {}): SlotsReturn + 'item-text'?: SlotProps + 'item-delete'?: SlotProps } diff --git a/src/runtime/components/Kbd.vue b/src/runtime/components/Kbd.vue index 3ad66e85f5..3029e6b1f7 100644 --- a/src/runtime/components/Kbd.vue +++ b/src/runtime/components/Kbd.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/kbd' import type { KbdKey } from '../composables/useKbd' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Kbd = ComponentConfig @@ -29,7 +30,7 @@ export interface KbdProps { } export interface KbdSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Link.vue b/src/runtime/components/Link.vue index a555269dc7..39213310be 100644 --- a/src/runtime/components/Link.vue +++ b/src/runtime/components/Link.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import type { RouterLinkProps, RouteLocationRaw } from 'vue-router' import theme from '#build/ui/link' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Link = ComponentConfig @@ -82,7 +83,7 @@ export interface LinkProps extends NuxtLinkProps { } export interface LinkSlots { - default(props: { active: boolean }): any + default?(props: { active: boolean }): SlotsReturn } diff --git a/src/runtime/components/Main.vue b/src/runtime/components/Main.vue index ea744b68e1..b01e2a7fa3 100644 --- a/src/runtime/components/Main.vue +++ b/src/runtime/components/Main.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/main' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Main = ComponentConfig @@ -15,7 +16,7 @@ export interface MainProps { } export interface MainSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Marquee.vue b/src/runtime/components/Marquee.vue index 0774ca5b80..9855a6b8d4 100644 --- a/src/runtime/components/Marquee.vue +++ b/src/runtime/components/Marquee.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/marquee' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Marquee = ComponentConfig @@ -41,7 +42,7 @@ export interface MarqueeProps { } export interface MarqueeSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Modal.vue b/src/runtime/components/Modal.vue index b06853d5e9..363532ccaa 100644 --- a/src/runtime/components/Modal.vue +++ b/src/runtime/components/Modal.vue @@ -3,7 +3,7 @@ import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogConten import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/modal' import type { ButtonProps, IconProps } from '../types' -import type { EmitsToProps } from '../types/utils' +import type { EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Modal = ComponentConfig @@ -61,15 +61,15 @@ export interface ModalEmits extends DialogRootEmits { } export interface ModalSlots { - default(props: { open: boolean }): any - content(props: { close: () => void }): any - header(props: { close: () => void }): any - title(props?: {}): any - description(props?: {}): any - actions(props?: {}): any - close(props: { close: () => void, ui: { [K in keyof Required]: (props?: Record) => string } }): any - body(props: { close: () => void }): any - footer(props: { close: () => void }): any + default?(props: { open: boolean }): SlotsReturn + content?(props: { close: () => void }): SlotsReturn + header?(props: { close: () => void }): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + close?(props: { close: () => void, ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn + body?(props: { close: () => void }): SlotsReturn + footer?(props: { close: () => void }): SlotsReturn } diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index b4641b77c8..2a9faaf6bf 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -4,7 +4,7 @@ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuCo import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/navigation-menu' import type { AvatarProps, BadgeProps, IconProps, LinkProps, PopoverProps, TooltipProps } from '../types' -import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps } from '../types/utils' +import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type NavigationMenu = ComponentConfig @@ -144,19 +144,19 @@ export interface NavigationMenuProps export interface NavigationMenuEmits extends NavigationMenuRootEmits {} -type SlotProps = (props: { item: T, index: number, active?: boolean }) => any +type SlotProps = (props: { item: T, index: number, active?: boolean }) => SlotsReturn export type NavigationMenuSlots< A extends ArrayOrNested = ArrayOrNested, T extends NestedItem = NestedItem > = { - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'item-content': SlotProps - 'list-leading': (props?: {}) => any - 'list-trailing': (props?: {}) => any + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'item-content'?: SlotProps + 'list-leading'?: (props?: {}) => SlotsReturn + 'list-trailing'?: (props?: {}) => SlotsReturn } & DynamicSlots, 'leading' | 'label' | 'trailing' | 'content', { index: number, active?: boolean }> diff --git a/src/runtime/components/Page.vue b/src/runtime/components/Page.vue index 616dc9cab2..a17eb99803 100644 --- a/src/runtime/components/Page.vue +++ b/src/runtime/components/Page.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Page = ComponentConfig @@ -16,9 +17,9 @@ export interface PageProps { } export interface PageSlots { - left(props?: {}): any - default(props?: {}): any - right(props?: {}): any + left?(props?: {}): SlotsReturn + default(props?: {}): SlotsReturn + right?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageAnchors.vue b/src/runtime/components/PageAnchors.vue index 719d431089..6025d4a2bb 100644 --- a/src/runtime/components/PageAnchors.vue +++ b/src/runtime/components/PageAnchors.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-anchors' import type { IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageAnchors = ComponentConfig @@ -27,13 +28,13 @@ export interface PageAnchorsProps { ui?: PageAnchors['slots'] } -type SlotProps = (props: { link: T, active: boolean }) => any +type SlotProps = (props: { link: T, active: boolean }) => SlotsReturn export interface PageAnchorsSlots { - 'link': SlotProps - 'link-leading': SlotProps - 'link-label': SlotProps - 'link-trailing': SlotProps + 'link'?: SlotProps + 'link-leading'?: SlotProps + 'link-label'?: SlotProps + 'link-trailing'?: SlotProps } diff --git a/src/runtime/components/PageAside.vue b/src/runtime/components/PageAside.vue index 06264e7f8f..3bf362b84b 100644 --- a/src/runtime/components/PageAside.vue +++ b/src/runtime/components/PageAside.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-aside' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageAside = ComponentConfig @@ -16,9 +17,9 @@ export interface PageAsideProps { } export interface PageAsideSlots { - top(props?: {}): any - default(props?: {}): any - bottom(props?: {}): any + top?(props?: {}): SlotsReturn + default(props?: {}): SlotsReturn + bottom?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageBody.vue b/src/runtime/components/PageBody.vue index cd1540cefa..5fe6c04dc0 100644 --- a/src/runtime/components/PageBody.vue +++ b/src/runtime/components/PageBody.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-body' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageBody = ComponentConfig @@ -15,7 +16,7 @@ export interface PageBodyProps { } export interface PageBodySlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageCTA.vue b/src/runtime/components/PageCTA.vue index 3fd3f10dbc..6eeff79d61 100644 --- a/src/runtime/components/PageCTA.vue +++ b/src/runtime/components/PageCTA.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-cta' import type { ButtonProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageCTA = ComponentConfig @@ -38,15 +39,15 @@ export interface PageCTAProps { } export interface PageCTASlots { - top(props?: {}): any - header(props?: {}): any - title(props?: {}): any - description(props?: {}): any - body(props?: {}): any - footer(props?: {}): any - links(props?: {}): any - default(props?: {}): any - bottom(props?: {}): any + top?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + links?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn + bottom?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageCard.vue b/src/runtime/components/PageCard.vue index 5640a8a891..e071dc5156 100644 --- a/src/runtime/components/PageCard.vue +++ b/src/runtime/components/PageCard.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-card' import type { IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageCard = ComponentConfig @@ -57,13 +58,13 @@ export interface PageCardProps { } export interface PageCardSlots { - header(props?: {}): any - body(props?: {}): any - leading(props?: {}): any - title(props?: {}): any - description(props?: {}): any - footer(props?: {}): any - default(props?: {}): any + header?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageColumns.vue b/src/runtime/components/PageColumns.vue index 7e99f6d509..68eaced86f 100644 --- a/src/runtime/components/PageColumns.vue +++ b/src/runtime/components/PageColumns.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-columns' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageColumns = ComponentConfig @@ -15,7 +16,7 @@ export interface PageColumnsProps { } export interface PageColumnsSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageFeature.vue b/src/runtime/components/PageFeature.vue index 6d289701f1..480d28c0ae 100644 --- a/src/runtime/components/PageFeature.vue +++ b/src/runtime/components/PageFeature.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-feature' import type { IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageFeature = ComponentConfig @@ -32,10 +33,10 @@ export interface PageFeatureProps { } export interface PageFeatureSlots { - leading(props?: {}): any - title(props?: {}): any - description(props?: {}): any - default(props?: {}): any + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageGrid.vue b/src/runtime/components/PageGrid.vue index 5be289c4e7..bddf69cecc 100644 --- a/src/runtime/components/PageGrid.vue +++ b/src/runtime/components/PageGrid.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-grid' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageGrid = ComponentConfig @@ -15,7 +16,7 @@ export interface PageGridProps { } export interface PageGridSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageHeader.vue b/src/runtime/components/PageHeader.vue index 75aaeef5be..9d94e8c483 100644 --- a/src/runtime/components/PageHeader.vue +++ b/src/runtime/components/PageHeader.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-header' import type { ButtonProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageHeader = ComponentConfig @@ -25,11 +26,11 @@ export interface PageHeaderProps { } export interface PageHeaderSlots { - headline(props?: {}): any - title(props?: {}): any - description(props?: {}): any - links(props?: {}): any - default(props?: {}): any + headline?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + links?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageHero.vue b/src/runtime/components/PageHero.vue index c987e8c21b..34e3843f4f 100644 --- a/src/runtime/components/PageHero.vue +++ b/src/runtime/components/PageHero.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-hero' import type { ButtonProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageHero = ComponentConfig @@ -35,16 +36,16 @@ export interface PageHeroProps { } export interface PageHeroSlots { - top(props?: {}): any - header(props?: {}): any - headline(props?: {}): any - title(props?: {}): any - description(props?: {}): any - body(props?: {}): any - footer(props?: {}): any - links(props?: {}): any - default(props?: {}): any - bottom(props?: {}): any + top?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + headline?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + links?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn + bottom?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageLinks.vue b/src/runtime/components/PageLinks.vue index f98b548311..19732ca7e6 100644 --- a/src/runtime/components/PageLinks.vue +++ b/src/runtime/components/PageLinks.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-links' import type { IconProps, LinkProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageLinks = ComponentConfig @@ -28,14 +29,14 @@ export interface PageLinksProps { ui?: PageLinks['slots'] } -type SlotProps = (props: { link: T, active: boolean }) => any +type SlotProps = (props: { link: T, active: boolean }) => SlotsReturn export interface PageLinksSlots { - 'title'(props?: {}): any - 'link': SlotProps - 'link-leading': SlotProps - 'link-label': SlotProps - 'link-trailing': SlotProps + 'title'?(props?: {}): SlotsReturn + 'link'?: SlotProps + 'link-leading'?: SlotProps + 'link-label'?: SlotProps + 'link-trailing'?: SlotProps } diff --git a/src/runtime/components/PageList.vue b/src/runtime/components/PageList.vue index 7fde32cdf3..53d0b56c82 100644 --- a/src/runtime/components/PageList.vue +++ b/src/runtime/components/PageList.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-list' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageList = ComponentConfig @@ -16,7 +17,7 @@ export interface PageListProps { } export interface PageListSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageLogos.vue b/src/runtime/components/PageLogos.vue index 06e2a1c9aa..f4d2a9e820 100644 --- a/src/runtime/components/PageLogos.vue +++ b/src/runtime/components/PageLogos.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-logos' import type { MarqueeProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageLogos = ComponentConfig @@ -25,7 +26,7 @@ export interface PageLogosProps { } export interface PageLogosSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PageSection.vue b/src/runtime/components/PageSection.vue index 03cbc7cac4..19e2d128d7 100644 --- a/src/runtime/components/PageSection.vue +++ b/src/runtime/components/PageSection.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/page-section' import type { ButtonProps, IconProps, PageFeatureProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PageSection = ComponentConfig @@ -47,18 +48,18 @@ export interface PageSectionProps { } export interface PageSectionSlots { - top(props?: {}): any - header(props?: {}): any - leading(props?: {}): any - headline(props?: {}): any - title(props?: {}): any - description(props?: {}): any - body(props?: {}): any - features(props?: {}): any - footer(props?: {}): any - links(props?: {}): any - default(props?: {}): any - bottom(props?: {}): any + top?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + leading?(props?: {}): SlotsReturn + headline?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + features?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + links?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn + bottom?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Pagination.vue b/src/runtime/components/Pagination.vue index 1bbe701b44..013852019f 100644 --- a/src/runtime/components/Pagination.vue +++ b/src/runtime/components/Pagination.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/pagination' import type { ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Pagination = ComponentConfig @@ -82,12 +83,12 @@ export interface PaginationProps extends Partial diff --git a/src/runtime/components/Popover.vue b/src/runtime/components/Popover.vue index 3e58f8f491..89946dee4b 100644 --- a/src/runtime/components/Popover.vue +++ b/src/runtime/components/Popover.vue @@ -2,7 +2,7 @@ import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps, HoverCardTriggerProps } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/popover' -import type { EmitsToProps } from '../types/utils' +import type { EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Popover = ComponentConfig @@ -51,9 +51,9 @@ export interface PopoverEmits extends PopoverRootEmits { type SlotProps = [M] extends ['hover'] ? {} : { close: () => void } export interface PopoverSlots { - default(props: { open: boolean }): any - content(props: SlotProps): any - anchor(props: SlotProps): any + default(props: { open: boolean }): SlotsReturn + content?(props: SlotProps): SlotsReturn + anchor?(props: SlotProps): SlotsReturn } diff --git a/src/runtime/components/PricingPlan.vue b/src/runtime/components/PricingPlan.vue index 912178ff96..6d8c4b107e 100644 --- a/src/runtime/components/PricingPlan.vue +++ b/src/runtime/components/PricingPlan.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/pricing-plan' import type { BadgeProps, ButtonProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PricingPlan = ComponentConfig @@ -92,19 +93,19 @@ export interface PricingPlanProps { } export interface PricingPlanSlots { - badge(props?: {}): any - title(props?: {}): any - description(props?: {}): any - price(props?: {}): any - discount(props?: {}): any - billing(props?: {}): any - features(props?: {}): any - button(props?: {}): any - header(props?: {}): any - body(props?: {}): any - footer(props?: {}): any - tagline(props?: {}): any - terms(props?: {}): any + badge?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + price?(props?: {}): SlotsReturn + discount?(props?: {}): SlotsReturn + billing?(props?: {}): SlotsReturn + features?(props?: {}): SlotsReturn + button?(props?: {}): SlotsReturn + header?(props?: {}): SlotsReturn + body?(props?: {}): SlotsReturn + footer?(props?: {}): SlotsReturn + tagline?(props?: {}): SlotsReturn + terms?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/PricingPlans.vue b/src/runtime/components/PricingPlans.vue index 198b7ec8d5..17a8f6e5f0 100644 --- a/src/runtime/components/PricingPlans.vue +++ b/src/runtime/components/PricingPlans.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/pricing-plans' import type { PricingPlanProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PricingPlans = ComponentConfig @@ -33,7 +34,7 @@ export interface PricingPlansProps { } export interface PricingPlansSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } @@ -55,7 +56,17 @@ const appConfig = useAppConfig() as PricingPlans['AppConfig'] const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.pricingPlans || {}) })) -const count = computed(() => props.plans?.length || slots.default?.()?.flatMap(mapSlot).filter(Boolean)?.length || 3) +const count = computed(() => { + if (props.plans?.length) { + return props.plans.length + } + const children = slots.default?.() + if (Array.isArray(children)) { + return children.flatMap(mapSlot).filter(Boolean).length || 3 + } else { + return children ? 1 : 3 + } +}) function mapSlot(slot: any) { if (typeof slot.type === 'symbol') { diff --git a/src/runtime/components/PricingTable.vue b/src/runtime/components/PricingTable.vue index f8f5c0671f..546df96da0 100644 --- a/src/runtime/components/PricingTable.vue +++ b/src/runtime/components/PricingTable.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/pricing-table' import type { PricingPlanProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type PricingTable = ComponentConfig @@ -13,7 +14,7 @@ type DynamicSlots }) => any + ]?: (props: { tier: Extract }) => SlotsReturn } type FeatureDynamicSlots = { @@ -22,7 +23,7 @@ type FeatureDynamicSlots any + ]?: (props: { feature: T, tier: PricingTableTier, section: PricingTableSection }) => SlotsReturn } type SectionDynamicSlots = { @@ -31,7 +32,7 @@ type SectionDynamicSlots any + ]?: (props: { section: T }) => SlotsReturn } export type PricingTableTier = Pick & { @@ -78,21 +79,21 @@ export interface PricingTableProps = (props: { tier: T }) => any +type SlotProps = (props: { tier: T }) => SlotsReturn export type PricingTableSlots = { - 'caption': (props?: {}) => any - 'tier': SlotProps - 'tier-title': SlotProps - 'tier-description': SlotProps - 'tier-badge': SlotProps - 'tier-button': SlotProps - 'tier-billing': SlotProps - 'tier-discount': SlotProps - 'tier-price': SlotProps - 'section-title': (props: { section: PricingTableSection }) => any - 'feature-title': (props: { feature: PricingTableSectionFeature, section: PricingTableSection }) => any - 'feature-value': (props: { feature: PricingTableSectionFeature, tier: T, section: PricingTableSection }) => any + 'caption'?: (props?: {}) => SlotsReturn + 'tier'?: SlotProps + 'tier-title'?: SlotProps + 'tier-description'?: SlotProps + 'tier-badge'?: SlotProps + 'tier-button'?: SlotProps + 'tier-billing'?: SlotProps + 'tier-discount'?: SlotProps + 'tier-price'?: SlotProps + 'section-title'?: (props: { section: PricingTableSection }) => SlotsReturn + 'feature-title'?: (props: { feature: PricingTableSectionFeature, section: PricingTableSection }) => SlotsReturn + 'feature-value'?: (props: { feature: PricingTableSectionFeature, tier: T, section: PricingTableSection }) => SlotsReturn } & DynamicSlots & FeatureDynamicSlots, 'title' | 'value'> & SectionDynamicSlots, 'title'> diff --git a/src/runtime/components/Progress.vue b/src/runtime/components/Progress.vue index 388acb9388..3b78d8a936 100644 --- a/src/runtime/components/Progress.vue +++ b/src/runtime/components/Progress.vue @@ -4,6 +4,7 @@ import type { ProgressRootProps, ProgressRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/progress' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Progress = ComponentConfig @@ -44,9 +45,9 @@ export interface ProgressProps extends Pick any + [key: string]: (props: { step: number }) => SlotsReturn } diff --git a/src/runtime/components/RadioGroup.vue b/src/runtime/components/RadioGroup.vue index f07b213a10..2e31b74bf9 100644 --- a/src/runtime/components/RadioGroup.vue +++ b/src/runtime/components/RadioGroup.vue @@ -2,7 +2,7 @@ import type { RadioGroupRootProps, RadioGroupRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/radio-group' -import type { AcceptableValue, GetItemKeys, GetModelValue } from '../types/utils' +import type { AcceptableValue, GetItemKeys, GetModelValue, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type RadioGroup = ComponentConfig @@ -77,12 +77,12 @@ export type RadioGroupEmits = RadioGroupRootEmits & { type NormalizeItem = Exclude -type SlotProps = (props: { item: NormalizeItem, modelValue?: RadioGroupValue }) => any +type SlotProps = (props: { item: NormalizeItem, modelValue?: RadioGroupValue }) => SlotsReturn export interface RadioGroupSlots { - legend(props?: {}): any - label: SlotProps - description: SlotProps + legend?(props?: {}): SlotsReturn + label?: SlotProps + description?: SlotProps } diff --git a/src/runtime/components/Select.vue b/src/runtime/components/Select.vue index 96da5bacb5..c3a8318c7e 100644 --- a/src/runtime/components/Select.vue +++ b/src/runtime/components/Select.vue @@ -4,7 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/select' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps, ChipProps, IconProps, InputProps } from '../types' -import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps } from '../types/utils' +import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Select = ComponentConfig @@ -105,7 +105,7 @@ export type SelectEmits, VK extends GetItemK focus: [event: FocusEvent] } & GetModelValueEmits -type SlotProps = (props: { item: T, index: number }) => any +type SlotProps = (props: { item: T, index: number }) => SlotsReturn export interface SelectSlots< A extends ArrayOrNested = ArrayOrNested, @@ -113,26 +113,26 @@ export interface SelectSlots< M extends boolean = false, T extends NestedItem = NestedItem > { - 'leading'(props: { + 'leading'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'default'(props: { + }): SlotsReturn + 'default'?(props: { modelValue?: GetModelValue open: boolean - }): any - 'trailing'(props: { + }): SlotsReturn + 'trailing'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'content-top': (props?: {}) => any - 'content-bottom': (props?: {}) => any + }): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'content-top'?: (props?: {}) => SlotsReturn + 'content-bottom'?: (props?: {}) => SlotsReturn } diff --git a/src/runtime/components/SelectMenu.vue b/src/runtime/components/SelectMenu.vue index 66d0d00a34..c427f72faf 100644 --- a/src/runtime/components/SelectMenu.vue +++ b/src/runtime/components/SelectMenu.vue @@ -4,7 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/select-menu' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps, ChipProps, IconProps, InputProps } from '../types' -import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps } from '../types/utils' +import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetItemValue, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type SelectMenu = ComponentConfig @@ -151,7 +151,7 @@ export type SelectMenuEmits, VK extends } | undefined] } & GetModelValueEmits -type SlotProps = (props: { item: T, index: number }) => any +type SlotProps = (props: { item: T, index: number }) => SlotsReturn export interface SelectMenuSlots< A extends ArrayOrNested = ArrayOrNested, @@ -159,28 +159,28 @@ export interface SelectMenuSlots< M extends boolean = false, T extends NestedItem = NestedItem > { - 'leading'(props: { + 'leading'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'default'(props: { + }): SlotsReturn + 'default'?(props: { modelValue?: GetModelValue open: boolean - }): any - 'trailing'(props: { + }): SlotsReturn + 'trailing'?(props: { modelValue?: GetModelValue open: boolean ui: { [K in keyof Required]: (props?: Record) => string } - }): any - 'empty'(props: { searchTerm?: string }): any - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps - 'content-top': (props?: {}) => any - 'content-bottom': (props?: {}) => any - 'create-item-label'(props: { item: string }): any + }): SlotsReturn + 'empty'?(props: { searchTerm?: string }): SlotsReturn + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps + 'content-top'?: (props?: {}) => SlotsReturn + 'content-bottom'?: (props?: {}) => SlotsReturn + 'create-item-label'?(props: { item: string }): SlotsReturn } diff --git a/src/runtime/components/Separator.vue b/src/runtime/components/Separator.vue index 2d58a14cfe..6299787285 100644 --- a/src/runtime/components/Separator.vue +++ b/src/runtime/components/Separator.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/separator' import type { AvatarProps, IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Separator = ComponentConfig @@ -44,7 +45,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> { } export interface SeparatorSlots { - default(props?: {}): any + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Slideover.vue b/src/runtime/components/Slideover.vue index 9df043f300..68a65019ec 100644 --- a/src/runtime/components/Slideover.vue +++ b/src/runtime/components/Slideover.vue @@ -3,7 +3,7 @@ import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogConten import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/slideover' import type { ButtonProps, IconProps } from '../types' -import type { EmitsToProps } from '../types/utils' +import type { EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Slideover = ComponentConfig @@ -61,15 +61,15 @@ export interface SlideoverEmits extends DialogRootEmits { } export interface SlideoverSlots { - default(props: { open: boolean }): any - content(props: { close: () => void }): any - header(props: { close: () => void }): any - title(props?: {}): any - description(props?: {}): any - actions(props?: {}): any - close(props: { close: () => void, ui: { [K in keyof Required]: (props?: Record) => string } }): any - body(props: { close: () => void }): any - footer(props: { close: () => void }): any + default?(props: { open: boolean }): SlotsReturn + content?(props: { close: () => void }): SlotsReturn + header?(props: { close: () => void }): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + close?(props: { close: () => void, ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn + body?(props: { close: () => void }): SlotsReturn + footer?(props: { close: () => void }): SlotsReturn } diff --git a/src/runtime/components/Stepper.vue b/src/runtime/components/Stepper.vue index 82dc4fd150..4da962e9ad 100644 --- a/src/runtime/components/Stepper.vue +++ b/src/runtime/components/Stepper.vue @@ -4,7 +4,7 @@ import type { StepperRootProps, StepperRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/stepper' import type { IconProps } from '../types' -import type { DynamicSlots } from '../types/utils' +import type { DynamicSlots, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Stepper = ComponentConfig @@ -59,13 +59,13 @@ export type StepperEmits = Omit = (props: { item: T }) => any +type SlotProps = (props: { item: T }) => SlotsReturn export type StepperSlots = { - indicator: SlotProps - title: SlotProps - description: SlotProps - content: SlotProps + indicator?: SlotProps + title?: SlotProps + description?: SlotProps + content?: SlotProps } & DynamicSlots diff --git a/src/runtime/components/Switch.vue b/src/runtime/components/Switch.vue index ada4ae985f..368cc1acd4 100644 --- a/src/runtime/components/Switch.vue +++ b/src/runtime/components/Switch.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/switch' import type { IconProps } from '../types' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Switch = ComponentConfig @@ -50,8 +51,8 @@ export type SwitchEmits = { } export interface SwitchSlots { - label(props: { label?: string }): any - description(props: { description?: string }): any + label?(props: { label?: string }): SlotsReturn + description?(props: { description?: string }): SlotsReturn } diff --git a/src/runtime/components/Table.vue b/src/runtime/components/Table.vue index 7fbe8e76bc..882530e7b2 100644 --- a/src/runtime/components/Table.vue +++ b/src/runtime/components/Table.vue @@ -38,6 +38,7 @@ import type { import type { VirtualizerOptions } from '@tanstack/vue-virtual' import theme from '#build/ui/table' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' declare module '@tanstack/table-core' { @@ -204,17 +205,17 @@ export interface TableProps extends TableOption ui?: Table['slots'] } -type DynamicHeaderSlots = Record) => any> & Record<`${K extends string ? K : never}-header`, (props: HeaderContext) => any> -type DynamicFooterSlots = Record) => any> & Record<`${K extends string ? K : never}-footer`, (props: HeaderContext) => any> -type DynamicCellSlots = Record) => any> & Record<`${K extends string ? K : never}-cell`, (props: CellContext) => any> +type DynamicHeaderSlots = Record) => SlotsReturn> & Record<`${K extends string ? K : never}-header`, (props: HeaderContext) => SlotsReturn> +type DynamicFooterSlots = Record) => SlotsReturn> & Record<`${K extends string ? K : never}-footer`, (props: HeaderContext) => SlotsReturn> +type DynamicCellSlots = Record) => SlotsReturn> & Record<`${K extends string ? K : never}-cell`, (props: CellContext) => SlotsReturn> export type TableSlots = { - 'expanded': (props: { row: Row }) => any - 'empty': (props?: {}) => any - 'loading': (props?: {}) => any - 'caption': (props?: {}) => any - 'body-top': (props?: {}) => any - 'body-bottom': (props?: {}) => any + 'expanded'?: (props: { row: Row }) => SlotsReturn + 'empty'?: (props?: {}) => SlotsReturn + 'loading'?: (props?: {}) => SlotsReturn + 'caption'?: (props?: {}) => SlotsReturn + 'body-top'?: (props?: {}) => SlotsReturn + 'body-bottom'?: (props?: {}) => SlotsReturn } & DynamicHeaderSlots & DynamicFooterSlots & DynamicCellSlots diff --git a/src/runtime/components/Tabs.vue b/src/runtime/components/Tabs.vue index 0c0877b283..41bb3f6e58 100644 --- a/src/runtime/components/Tabs.vue +++ b/src/runtime/components/Tabs.vue @@ -1,10 +1,11 @@ diff --git a/src/runtime/components/Timeline.vue b/src/runtime/components/Timeline.vue index 213656441d..875114ab17 100644 --- a/src/runtime/components/Timeline.vue +++ b/src/runtime/components/Timeline.vue @@ -3,7 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/timeline' import type { AvatarProps, IconProps } from '../types' -import type { DynamicSlots } from '../types/utils' +import type { DynamicSlots, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Timeline = ComponentConfig @@ -47,13 +47,13 @@ export interface TimelineProps { ui?: Timeline['slots'] } -type SlotProps = (props: { item: T }) => any +type SlotProps = (props: { item: T }) => SlotsReturn export type TimelineSlots = { - indicator: SlotProps - date: SlotProps - title: SlotProps - description: SlotProps + indicator?: SlotProps + date?: SlotProps + title?: SlotProps + description?: SlotProps } & DynamicSlots diff --git a/src/runtime/components/Toast.vue b/src/runtime/components/Toast.vue index d2f04e2dad..d8342cff75 100644 --- a/src/runtime/components/Toast.vue +++ b/src/runtime/components/Toast.vue @@ -3,7 +3,7 @@ import type { ToastRootProps, ToastRootEmits } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/toast' import type { AvatarProps, ButtonProps, IconProps, ProgressProps } from '../types' -import type { StringOrVNode } from '../types/utils' +import type { StringOrVNode, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Toast = ComponentConfig @@ -62,11 +62,11 @@ export interface ToastProps extends Pick]: (props?: Record) => string } }): any + leading?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + actions?(props?: {}): SlotsReturn + close?(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): SlotsReturn } diff --git a/src/runtime/components/Toaster.vue b/src/runtime/components/Toaster.vue index 5ecc7ee219..839026428f 100644 --- a/src/runtime/components/Toaster.vue +++ b/src/runtime/components/Toaster.vue @@ -3,6 +3,7 @@ import type { ToastProviderProps } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/toaster' import type { ComponentConfig } from '../types/tv' +import type { SlotsReturn } from '../types/utils' type Toaster = ComponentConfig @@ -37,7 +38,7 @@ export interface ToasterProps extends Omit } export interface ToasterSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } export default { diff --git a/src/runtime/components/Tooltip.vue b/src/runtime/components/Tooltip.vue index 19f86cd6a1..269cc2d8e2 100644 --- a/src/runtime/components/Tooltip.vue +++ b/src/runtime/components/Tooltip.vue @@ -3,7 +3,7 @@ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipCo import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/tooltip' import type { KbdProps } from '../types' -import type { EmitsToProps } from '../types/utils' +import type { EmitsToProps, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Tooltip = ComponentConfig @@ -41,8 +41,8 @@ export interface TooltipProps extends TooltipRootProps { export interface TooltipEmits extends TooltipRootEmits {} export interface TooltipSlots { - default(props: { open: boolean }): any - content(props?: {}): any + default(props: { open: boolean }): SlotsReturn + content?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/Tree.vue b/src/runtime/components/Tree.vue index 6b52f7f657..797e6816f5 100644 --- a/src/runtime/components/Tree.vue +++ b/src/runtime/components/Tree.vue @@ -4,7 +4,7 @@ import type { TreeRootProps, TreeRootEmits, TreeItemSelectEvent, TreeItemToggleE import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/tree' import type { IconProps } from '../types' -import type { DynamicSlots, GetItemKeys } from '../types/utils' +import type { DynamicSlots, GetItemKeys, SlotsReturn } from '../types/utils' import type { ComponentConfig } from '../types/tv' type Tree = ComponentConfig @@ -116,16 +116,16 @@ type SlotProps = (props: { indeterminate: boolean | undefined handleSelect: () => void handleToggle: () => void -}) => any +}) => SlotsReturn export type TreeSlots< T extends TreeItem[] = TreeItem[] > = { - 'item-wrapper': SlotProps - 'item': SlotProps - 'item-leading': SlotProps - 'item-label': SlotProps - 'item-trailing': SlotProps + 'item-wrapper'?: SlotProps + 'item'?: SlotProps + 'item-leading'?: SlotProps + 'item-label'?: SlotProps + 'item-trailing'?: SlotProps } & DynamicSlots @@ -33,10 +34,10 @@ export interface UserProps { } export interface UserSlots { - avatar(props?: {}): any - name(props?: {}): any - description(props?: {}): any - default(props?: {}): any + avatar?(props?: {}): SlotsReturn + name?(props?: {}): SlotsReturn + description?(props?: {}): SlotsReturn + default?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/color-mode/ColorModeButton.vue b/src/runtime/components/color-mode/ColorModeButton.vue index 0d8ad091ad..fdaba77e00 100644 --- a/src/runtime/components/color-mode/ColorModeButton.vue +++ b/src/runtime/components/color-mode/ColorModeButton.vue @@ -18,6 +18,7 @@ import { computed } from 'vue' import { useColorMode, useAppConfig } from '#imports' import { useLocale } from '../../composables/useLocale' import UButton from '../Button.vue' +import type { SlotsReturn } from '../../types/utils' defineOptions({ inheritAttrs: false }) @@ -26,7 +27,7 @@ withDefaults(defineProps(), { variant: 'ghost' }) defineSlots<{ - fallback(props?: {}): any + fallback?(props?: {}): SlotsReturn }>() const { t } = useLocale() diff --git a/src/runtime/components/content/ContentNavigation.vue b/src/runtime/components/content/ContentNavigation.vue index 01caa4135e..3812dadcb5 100644 --- a/src/runtime/components/content/ContentNavigation.vue +++ b/src/runtime/components/content/ContentNavigation.vue @@ -5,6 +5,7 @@ import type { ContentNavigationItem } from '@nuxt/content' import theme from '#build/ui/content/content-navigation' import type { BadgeProps, IconProps, LinkProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ContentNavigation = ComponentConfig @@ -80,13 +81,13 @@ export interface ContentNavigationProps = (props: { link: T, active?: boolean }) => any +type SlotProps = (props: { link: T, active?: boolean }) => SlotsReturn export interface ContentNavigationSlots { - 'link': SlotProps - 'link-leading': SlotProps - 'link-title': SlotProps - 'link-trailing': SlotProps + 'link'?: SlotProps + 'link-leading'?: SlotProps + 'link-title'?: SlotProps + 'link-trailing'?: SlotProps } diff --git a/src/runtime/components/content/ContentSearch.vue b/src/runtime/components/content/ContentSearch.vue index 26b5b9af27..db9fa18d8c 100644 --- a/src/runtime/components/content/ContentSearch.vue +++ b/src/runtime/components/content/ContentSearch.vue @@ -6,6 +6,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse' import theme from '#build/ui/content/content-search' import type { ButtonProps, InputProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ContentSearch = ComponentConfig @@ -99,7 +100,7 @@ export interface ContentSearchProps, ContentSearchItem> & { - content(props?: {}): any + content?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/content/ContentSurround.vue b/src/runtime/components/content/ContentSurround.vue index 29bc2061ed..f7eb499092 100644 --- a/src/runtime/components/content/ContentSurround.vue +++ b/src/runtime/components/content/ContentSurround.vue @@ -1,9 +1,11 @@ diff --git a/src/runtime/components/prose/A.vue b/src/runtime/components/prose/A.vue index b07667f148..78e85a279c 100644 --- a/src/runtime/components/prose/A.vue +++ b/src/runtime/components/prose/A.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/a' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseA = ComponentConfig @@ -12,7 +13,7 @@ export interface ProseAProps { } export interface ProseASlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Accordion.vue b/src/runtime/components/prose/Accordion.vue index dd2ba99b0a..22f5fa82d8 100644 --- a/src/runtime/components/prose/Accordion.vue +++ b/src/runtime/components/prose/Accordion.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/accordion' import type { AccordionProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseAccordion = ComponentConfig @@ -13,7 +14,7 @@ export interface ProseAccordionProps { } export interface ProseAccordionSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } @@ -44,7 +45,11 @@ const items = computed<{ }[]>(() => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions rerenderCount.value - return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [] + let children = slots.default?.() + if (!Array.isArray(children)) { + children = children ? [children] : [] + } + return children?.flatMap(transformSlot).filter(Boolean) || [] }) function transformSlot(slot: any, index: number) { diff --git a/src/runtime/components/prose/AccordionItem.vue b/src/runtime/components/prose/AccordionItem.vue index 369a9a6b6a..5172410ec6 100644 --- a/src/runtime/components/prose/AccordionItem.vue +++ b/src/runtime/components/prose/AccordionItem.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Badge.vue b/src/runtime/components/prose/Badge.vue index 9294e9d3f8..a042255cf0 100644 --- a/src/runtime/components/prose/Badge.vue +++ b/src/runtime/components/prose/Badge.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/badge' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseBadge = ComponentConfig @@ -10,7 +11,7 @@ export interface ProseBadgeProps { } export interface ProseBadgeSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Blockquote.vue b/src/runtime/components/prose/Blockquote.vue index 77fa64634c..83f3981b04 100644 --- a/src/runtime/components/prose/Blockquote.vue +++ b/src/runtime/components/prose/Blockquote.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import type { ComponentConfig } from '../../types/tv' import theme from '#build/ui/prose/blockquote' +import type { SlotsReturn } from '../../types/utils' type ProseBlockquote = ComponentConfig @@ -10,7 +11,7 @@ export interface ProseBlockquoteProps { } export interface ProseBlockquoteSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Callout.vue b/src/runtime/components/prose/Callout.vue index 750400d946..f4f283db54 100644 --- a/src/runtime/components/prose/Callout.vue +++ b/src/runtime/components/prose/Callout.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/callout' import type { IconProps, LinkProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseCallout = ComponentConfig @@ -19,7 +20,7 @@ export interface ProseCalloutProps { } export interface ProseCalloutSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Card.vue b/src/runtime/components/prose/Card.vue index 312183d49f..2136601c0f 100644 --- a/src/runtime/components/prose/Card.vue +++ b/src/runtime/components/prose/Card.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/card' import type { IconProps, LinkProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseCard = ComponentConfig @@ -21,8 +22,8 @@ export interface ProseCardProps { } export interface ProseCardSlots { - default(props?: {}): any - title(props?: {}): any + default?(props?: {}): SlotsReturn + title?(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/CardGroup.vue b/src/runtime/components/prose/CardGroup.vue index 4ed8659a57..919990d5df 100644 --- a/src/runtime/components/prose/CardGroup.vue +++ b/src/runtime/components/prose/CardGroup.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Code.vue b/src/runtime/components/prose/Code.vue index f35345ba11..300235750f 100644 --- a/src/runtime/components/prose/Code.vue +++ b/src/runtime/components/prose/Code.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/CodeCollapse.vue b/src/runtime/components/prose/CodeCollapse.vue index 041389ed49..36be61c77c 100644 --- a/src/runtime/components/prose/CodeCollapse.vue +++ b/src/runtime/components/prose/CodeCollapse.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/code-collapse' import type { IconProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseCodeCollapse = ComponentConfig @@ -32,7 +33,7 @@ export interface ProseCodeCollapseProps { } export interface ProseCodeCollapseSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/CodeGroup.vue b/src/runtime/components/prose/CodeGroup.vue index 6b8622275f..9a8c203c83 100644 --- a/src/runtime/components/prose/CodeGroup.vue +++ b/src/runtime/components/prose/CodeGroup.vue @@ -1,6 +1,7 @@ @@ -53,7 +54,11 @@ const items = computed<{ }[]>(() => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions rerenderCount.value - return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [] + let children = slots.default?.() + if (!Array.isArray(children)) { + children = children ? [children] : [] + } + return children?.flatMap(transformSlot).filter(Boolean) || [] }) function transformSlot(slot: any, index: number) { diff --git a/src/runtime/components/prose/CodePreview.vue b/src/runtime/components/prose/CodePreview.vue index d7813b83ac..c2a8348773 100644 --- a/src/runtime/components/prose/CodePreview.vue +++ b/src/runtime/components/prose/CodePreview.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/CodeTree.vue b/src/runtime/components/prose/CodeTree.vue index ed52d98f93..2028127003 100644 --- a/src/runtime/components/prose/CodeTree.vue +++ b/src/runtime/components/prose/CodeTree.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/code-tree' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseCodeTree = ComponentConfig @@ -27,7 +28,7 @@ export interface ProseCodeTreeProps { } export interface ProseCodeTreeSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } @@ -64,7 +65,11 @@ const flatItems = computed<{ }[]>(() => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions rerenderCount.value - return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [] + let children = slots.default?.() + if (!Array.isArray(children)) { + children = children ? [children] : [] + } + return children?.flatMap(transformSlot).filter(Boolean) || [] }) const items = computed(() => buildTree(flatItems.value)) diff --git a/src/runtime/components/prose/Collapsible.vue b/src/runtime/components/prose/Collapsible.vue index 4e2aa1038e..c28f485dcd 100644 --- a/src/runtime/components/prose/Collapsible.vue +++ b/src/runtime/components/prose/Collapsible.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/collapsible' import type { IconProps, CollapsibleProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseCollapsible = ComponentConfig @@ -32,7 +33,7 @@ export interface ProseCollapsibleProps { } export interface ProseCollapsibleSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Em.vue b/src/runtime/components/prose/Em.vue index e382b7dd48..b786f90550 100644 --- a/src/runtime/components/prose/Em.vue +++ b/src/runtime/components/prose/Em.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Field.vue b/src/runtime/components/prose/Field.vue index 2bcc38b04b..925d0ac9a3 100644 --- a/src/runtime/components/prose/Field.vue +++ b/src/runtime/components/prose/Field.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/FieldGroup.vue b/src/runtime/components/prose/FieldGroup.vue index 277f2d49cb..3ad2a765e3 100644 --- a/src/runtime/components/prose/FieldGroup.vue +++ b/src/runtime/components/prose/FieldGroup.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/H1.vue b/src/runtime/components/prose/H1.vue index f3541d2600..8c64128aba 100644 --- a/src/runtime/components/prose/H1.vue +++ b/src/runtime/components/prose/H1.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/H2.vue b/src/runtime/components/prose/H2.vue index 125978b4f9..22e7c3e1fb 100644 --- a/src/runtime/components/prose/H2.vue +++ b/src/runtime/components/prose/H2.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/h2' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseH2 = ComponentConfig @@ -12,7 +13,7 @@ export interface ProseH2Props { } export interface ProseH2Slots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/H3.vue b/src/runtime/components/prose/H3.vue index 958b7d5167..c35fde84a2 100644 --- a/src/runtime/components/prose/H3.vue +++ b/src/runtime/components/prose/H3.vue @@ -2,6 +2,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/h3' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseH3 = ComponentConfig @@ -12,7 +13,7 @@ export interface ProseH3Props { } export interface ProseH3Slots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/H4.vue b/src/runtime/components/prose/H4.vue index ff8b46f06f..3d8c4c5e98 100644 --- a/src/runtime/components/prose/H4.vue +++ b/src/runtime/components/prose/H4.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Li.vue b/src/runtime/components/prose/Li.vue index 24fe19dc39..6ab3ebd69f 100644 --- a/src/runtime/components/prose/Li.vue +++ b/src/runtime/components/prose/Li.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Ol.vue b/src/runtime/components/prose/Ol.vue index 155c5c00eb..841b49d233 100644 --- a/src/runtime/components/prose/Ol.vue +++ b/src/runtime/components/prose/Ol.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/P.vue b/src/runtime/components/prose/P.vue index 1c30334624..084da3097c 100644 --- a/src/runtime/components/prose/P.vue +++ b/src/runtime/components/prose/P.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Pre.vue b/src/runtime/components/prose/Pre.vue index 6c1e0c655d..c52b40f601 100644 --- a/src/runtime/components/prose/Pre.vue +++ b/src/runtime/components/prose/Pre.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/pre' import type { IconProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProsePre = ComponentConfig @@ -19,7 +20,7 @@ export interface ProsePreProps { } export interface ProsePreSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } diff --git a/src/runtime/components/prose/Steps.vue b/src/runtime/components/prose/Steps.vue index ee2ce19c27..06e63f7021 100644 --- a/src/runtime/components/prose/Steps.vue +++ b/src/runtime/components/prose/Steps.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Strong.vue b/src/runtime/components/prose/Strong.vue index 23ac2b45c2..15377431a3 100644 --- a/src/runtime/components/prose/Strong.vue +++ b/src/runtime/components/prose/Strong.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Table.vue b/src/runtime/components/prose/Table.vue index e16dd8e5cf..8ca15da008 100644 --- a/src/runtime/components/prose/Table.vue +++ b/src/runtime/components/prose/Table.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Tabs.vue b/src/runtime/components/prose/Tabs.vue index 7e96c4213e..c85a4d2c67 100644 --- a/src/runtime/components/prose/Tabs.vue +++ b/src/runtime/components/prose/Tabs.vue @@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/prose/tabs' import type { TabsProps } from '../../types' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type ProseTabs = ComponentConfig @@ -25,7 +26,7 @@ export interface ProseTabsProps { } export interface ProseTabsSlots { - default(props?: {}): any + default(props?: {}): SlotsReturn } @@ -58,7 +59,11 @@ const items = computed<{ }[]>(() => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions rerenderCount.value - return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [] + let children = slots.default?.() + if (!Array.isArray(children)) { + children = children ? [children] : [] + } + return children?.flatMap(transformSlot).filter(Boolean) || [] }) function transformSlot(slot: any, index: number) { diff --git a/src/runtime/components/prose/TabsItem.vue b/src/runtime/components/prose/TabsItem.vue index 49d30a8835..32445c35fc 100644 --- a/src/runtime/components/prose/TabsItem.vue +++ b/src/runtime/components/prose/TabsItem.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Tbody.vue b/src/runtime/components/prose/Tbody.vue index 2dfe56afb5..4bb3164a0a 100644 --- a/src/runtime/components/prose/Tbody.vue +++ b/src/runtime/components/prose/Tbody.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Td.vue b/src/runtime/components/prose/Td.vue index 87fe88e49f..760abb50ef 100644 --- a/src/runtime/components/prose/Td.vue +++ b/src/runtime/components/prose/Td.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Th.vue b/src/runtime/components/prose/Th.vue index 9a04a0cf67..5e9e169184 100644 --- a/src/runtime/components/prose/Th.vue +++ b/src/runtime/components/prose/Th.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Thead.vue b/src/runtime/components/prose/Thead.vue index 8dc6de681a..b64b645f30 100644 --- a/src/runtime/components/prose/Thead.vue +++ b/src/runtime/components/prose/Thead.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Tr.vue b/src/runtime/components/prose/Tr.vue index a4619d3e94..a50468b597 100644 --- a/src/runtime/components/prose/Tr.vue +++ b/src/runtime/components/prose/Tr.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/components/prose/Ul.vue b/src/runtime/components/prose/Ul.vue index d5558977f8..1e7a9e2d9d 100644 --- a/src/runtime/components/prose/Ul.vue +++ b/src/runtime/components/prose/Ul.vue @@ -1,6 +1,7 @@ diff --git a/src/runtime/inertia/components/Link.vue b/src/runtime/inertia/components/Link.vue index 1061d74197..b813df89ce 100644 --- a/src/runtime/inertia/components/Link.vue +++ b/src/runtime/inertia/components/Link.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import type { InertiaLinkProps } from '@inertiajs/vue3' import theme from '#build/ui/link' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type Link = ComponentConfig @@ -53,7 +54,7 @@ export interface LinkProps extends NuxtLinkProps { } export interface LinkSlots { - default(props: { active: boolean }): any + default(props: { active: boolean }): SlotsReturn } diff --git a/src/runtime/types/utils.ts b/src/runtime/types/utils.ts index aaacba9d66..d1c1468b4e 100644 --- a/src/runtime/types/utils.ts +++ b/src/runtime/types/utils.ts @@ -5,6 +5,9 @@ export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P] | undefined } +export type MaybeArray = T | T[] +export type SlotsReturn = MaybeArray + export type DynamicSlotsKeys = ( Name extends string ? Suffix extends string @@ -17,9 +20,9 @@ export type DynamicSlots< Suffix extends string | undefined = undefined, ExtraProps extends object = {} > = { - [K in DynamicSlotsKeys]: ( + [K in DynamicSlotsKeys]?: ( props: { item: Extract } & ExtraProps - ) => any + ) => SlotsReturn } export type GetObjectField = MaybeObject extends Record diff --git a/src/runtime/vue/components/Link.vue b/src/runtime/vue/components/Link.vue index 89775d09ad..cfd21e48eb 100644 --- a/src/runtime/vue/components/Link.vue +++ b/src/runtime/vue/components/Link.vue @@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import type { RouterLinkProps, RouteLocationRaw } from 'vue-router' import theme from '#build/ui/link' import type { ComponentConfig } from '../../types/tv' +import type { SlotsReturn } from '../../types/utils' type Link = ComponentConfig @@ -82,7 +83,7 @@ export interface LinkProps extends NuxtLinkProps { } export interface LinkSlots { - default(props: { active: boolean }): any + default(props: { active: boolean }): SlotsReturn } diff --git a/test/components/Accordion.spec.ts b/test/components/Accordion.spec.ts index 3e34131b05..7cc5f84a6e 100644 --- a/test/components/Accordion.spec.ts +++ b/test/components/Accordion.spec.ts @@ -60,7 +60,7 @@ describe('Accordion', () => { ['with body slot', { props: { ...props, modelValue: '1' }, slots: { body: () => 'Body slot' } }], ['with custom slot', { props: { ...props, modelValue: '5' }, slots: { custom: () => 'Custom slot' } }], ['with custom body slot', { props: { ...props, modelValue: '5' }, slots: { 'custom-body': () => 'Custom body slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AccordionProps, slots?: Partial 'Custom slot' } & { 'custom-body': () => 'Custom body slot' }> }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AccordionProps, slots?: AccordionSlots & { custom?: () => 'Custom slot' } & { 'custom-body'?: () => 'Custom body slot' } }) => { const html = await ComponentRender(nameOrHtml, options, Accordion) expect(html).toMatchSnapshot() }) diff --git a/test/components/Alert.spec.ts b/test/components/Alert.spec.ts index 905d096984..3cfde9184b 100644 --- a/test/components/Alert.spec.ts +++ b/test/components/Alert.spec.ts @@ -32,7 +32,7 @@ describe('Alert', () => { ['with title slot', { props, slots: { title: () => 'Title slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with close slot', { props, slots: { close: () => 'Close slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AlertProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AlertProps, slots?: AlertSlots }) => { const html = await ComponentRender(nameOrHtml, options, Alert) expect(html).toMatchSnapshot() }) diff --git a/test/components/AuthForm.spec.ts b/test/components/AuthForm.spec.ts index 0a3b46233a..6e6903880b 100644 --- a/test/components/AuthForm.spec.ts +++ b/test/components/AuthForm.spec.ts @@ -42,7 +42,7 @@ describe('AuthForm', () => { ['with validation slot', { props, slots: { validation: () => 'Validation' } }], ['with submit slot', { props, slots: { submit: () => 'Submit' } }], ['with footer slot', { props, slots: { footer: () => 'Footer' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props: AuthFormProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props: AuthFormProps, slots?: AuthFormSlots }) => { const html = await ComponentRender(nameOrHtml, options, AuthForm) expect(html).toMatchSnapshot() }) diff --git a/test/components/AvatarGroup.spec.ts b/test/components/AvatarGroup.spec.ts index 445f334263..2f0b7ed9b3 100644 --- a/test/components/AvatarGroup.spec.ts +++ b/test/components/AvatarGroup.spec.ts @@ -32,7 +32,7 @@ describe('AvatarGroup', () => { ['with ui', { props: { ui: { base: 'rounded-lg' } } }], // Slots ['with default slot', {}] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AvatarGroupProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: AvatarGroupProps, slots?: AvatarGroupSlots }) => { const html = await ComponentRender(nameOrHtml, options, AvatarGroupWrapper) expect(html).toMatchSnapshot() }) diff --git a/test/components/Badge.spec.ts b/test/components/Badge.spec.ts index c6f41cfc01..a4c18e3b4f 100644 --- a/test/components/Badge.spec.ts +++ b/test/components/Badge.spec.ts @@ -32,7 +32,7 @@ describe('Badge', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with leading slot', { slots: { leading: () => 'Leading slot' } }], ['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BadgeProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BadgeProps, slots?: BadgeSlots }) => { const html = await ComponentRender(nameOrHtml, options, Badge) expect(html).toMatchSnapshot() }) diff --git a/test/components/Banner.spec.ts b/test/components/Banner.spec.ts index 9c17feb3e9..7b252ebdb8 100644 --- a/test/components/Banner.spec.ts +++ b/test/components/Banner.spec.ts @@ -27,7 +27,7 @@ describe('Banner', () => { ['with title slot', { props, slots: { title: () => 'Title slot' } }], ['with actions slot', { props, slots: { actions: () => 'Actions slot' } }], ['with close slot', { props, slots: { close: () => 'Close slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BannerProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BannerProps, slots?: BannerSlots }) => { const html = await ComponentRender(nameOrHtml, options, Banner) expect(html).toMatchSnapshot() }) diff --git a/test/components/BlogPost.spec.ts b/test/components/BlogPost.spec.ts index 149dbd72b6..dc25b9187e 100644 --- a/test/components/BlogPost.spec.ts +++ b/test/components/BlogPost.spec.ts @@ -58,7 +58,7 @@ describe('BlogPost', () => { ['with header slot', { props, slots: { header: () => 'Header slot' } }], ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BlogPostProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BlogPostProps, slots?: BlogPostSlots }) => { const html = await ComponentRender(nameOrHtml, options, BlogPost) expect(html).toMatchSnapshot() }) diff --git a/test/components/BlogPosts.spec.ts b/test/components/BlogPosts.spec.ts index 92adc107ac..dd301571d4 100644 --- a/test/components/BlogPosts.spec.ts +++ b/test/components/BlogPosts.spec.ts @@ -33,7 +33,7 @@ describe('BlogPosts', () => { ['with class', { props: { ...props, class: 'gap-y-12' } }], // Slots ['with default slot', { props, slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BlogPostsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BlogPostsProps, slots?: BlogPostsSlots }) => { const html = await ComponentRender(nameOrHtml, options, BlogPosts) expect(html).toMatchSnapshot() }) diff --git a/test/components/Breadcrumb.spec.ts b/test/components/Breadcrumb.spec.ts index 89194552d1..09b6b8b9e5 100644 --- a/test/components/Breadcrumb.spec.ts +++ b/test/components/Breadcrumb.spec.ts @@ -41,7 +41,7 @@ describe('Breadcrumb', () => { ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }], ['with separator slot', { props, slots: { separator: () => '/' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BreadcrumbProps, slots?: Partial 'Custom slot' }> }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: BreadcrumbProps, slots?: BreadcrumbSlots & { custom?: () => 'Custom slot' } }) => { const html = await ComponentRender(nameOrHtml, options, Breadcrumb) expect(html).toMatchSnapshot() }) diff --git a/test/components/Button.spec.ts b/test/components/Button.spec.ts index 75afdf4f23..acc66867c3 100644 --- a/test/components/Button.spec.ts +++ b/test/components/Button.spec.ts @@ -46,7 +46,7 @@ describe('Button', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with leading slot', { slots: { leading: () => 'Leading slot' } }], ['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ButtonProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ButtonProps, slots?: ButtonSlots }) => { const html = await ComponentRender(nameOrHtml, options, Button) expect(html).toMatchSnapshot() }) diff --git a/test/components/Calendar.spec.ts b/test/components/Calendar.spec.ts index f3350fec4b..7298bfa94c 100644 --- a/test/components/Calendar.spec.ts +++ b/test/components/Calendar.spec.ts @@ -46,9 +46,9 @@ describe('Calendar', () => { ['with ui', { props: { ui: { header: 'gap-4' } } }], // Slots ['with heading slot', { slots: { heading: () => 'Heading' } }], - ['with day slot', { slots: { day: ({ day }: Parameters[0]) => day.day } }], - ['with week-day slot', { slots: { 'week-day': ({ day }: Parameters[0]) => day } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CalendarProps, slots?: Partial }) => { + ['with day slot', { slots: { day: ({ day }: Parameters['day']>[0]) => day.day } }], + ['with week-day slot', { slots: { 'week-day': ({ day }: Parameters['week-day']>[0]) => day } }] + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CalendarProps, slots?: CalendarSlots }) => { const html = await ComponentRender(nameOrHtml, options, Calendar) expect(html).toMatchSnapshot() }) diff --git a/test/components/Card.spec.ts b/test/components/Card.spec.ts index f537d74aed..ea4a75ca4f 100644 --- a/test/components/Card.spec.ts +++ b/test/components/Card.spec.ts @@ -19,7 +19,7 @@ describe('Card', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with header slot', { slots: { header: () => 'Header slot' } }], ['with footer slot', { slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CardProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CardProps, slots?: CardSlots }) => { const html = await ComponentRender(nameOrHtml, options, Card) expect(html).toMatchSnapshot() }) diff --git a/test/components/Carousel.spec.ts b/test/components/Carousel.spec.ts index bb499e354c..091a5e4f14 100644 --- a/test/components/Carousel.spec.ts +++ b/test/components/Carousel.spec.ts @@ -40,7 +40,7 @@ describe('Carousel', () => { ['with as', { props: { ...props, as: 'nav' } }], ['with class', { props: { ...props, class: 'w-full max-w-xs' } }], ['with ui', { props: { ...props, ui: { viewport: 'h-[320px]' } } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CarouselProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CarouselProps, slots?: CarouselSlots }) => { const html = await ComponentRender(nameOrHtml, options, CarouselWrapper) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChangelogVersion.spec.ts b/test/components/ChangelogVersion.spec.ts index 60a895f5f8..14584d0cee 100644 --- a/test/components/ChangelogVersion.spec.ts +++ b/test/components/ChangelogVersion.spec.ts @@ -35,7 +35,7 @@ describe('ChangelogVersion', () => { ['with authors slot', { slots: { authors: () => 'Authors slot' } }], ['with actions slot', { slots: { actions: () => 'Actions slot' } }], ['with indicator slot', { slots: { indicator: () => 'Indicator slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChangelogVersionProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChangelogVersionProps, slots?: ChangelogVersionSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChangelogVersion) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChangelogVersions.spec.ts b/test/components/ChangelogVersions.spec.ts index 4a3adac132..cc21d2fc5b 100644 --- a/test/components/ChangelogVersions.spec.ts +++ b/test/components/ChangelogVersions.spec.ts @@ -36,7 +36,7 @@ describe('ChangelogVersions', () => { // Slots ['with default slot', { props, slots: { default: () => 'Default slot' } }], ['with indicator slot', { props, slots: { indicator: () => 'Indicator slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChangelogVersionsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChangelogVersionsProps, slots?: ChangelogVersionsSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChangelogVersions) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChatMessage.spec.ts b/test/components/ChatMessage.spec.ts index a25ae09a52..700ffe7f4e 100644 --- a/test/components/ChatMessage.spec.ts +++ b/test/components/ChatMessage.spec.ts @@ -29,7 +29,7 @@ describe('ChatMessage', () => { ['with ui', { props: { ...props, ui: {} } }], // Slots ['with content slot', { props, slots: { content: () => 'Content slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatMessageProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatMessageProps, slots?: ChatMessageSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChatMessage) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChatMessages.spec.ts b/test/components/ChatMessages.spec.ts index e46a595512..add45b1334 100644 --- a/test/components/ChatMessages.spec.ts +++ b/test/components/ChatMessages.spec.ts @@ -34,7 +34,7 @@ describe('ChatMessages', () => { ['with indicator slot', { props: { ...props, status: 'submitted' }, slots: { indicator: () => 'Indicator slot' } }], ['with viewport slot', { props, slots: { viewport: () => 'Viewport slot' } }], ['with content slot', { props, slots: { content: () => 'Content slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatMessagesProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatMessagesProps, slots?: ChatMessagesSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChatMessages) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChatPalette.spec.ts b/test/components/ChatPalette.spec.ts index c7f7aca12b..e3cdfbed0f 100644 --- a/test/components/ChatPalette.spec.ts +++ b/test/components/ChatPalette.spec.ts @@ -14,7 +14,7 @@ describe('ChatPalette', () => { // Slots ['with default slot', { slots: { default: () => 'Default slot' } }], ['with prompt slot', { slots: { prompt: () => 'Prompt slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatPaletteProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatPaletteProps, slots?: ChatPaletteSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChatPalette) expect(html).toMatchSnapshot() }) diff --git a/test/components/ChatPrompt.spec.ts b/test/components/ChatPrompt.spec.ts index d5da2a105c..bfdda28c4e 100644 --- a/test/components/ChatPrompt.spec.ts +++ b/test/components/ChatPrompt.spec.ts @@ -20,7 +20,7 @@ describe('ChatPrompt', () => { // Slots ['with header slot', { slots: { header: () => 'Header slot' } }], ['with footer slot', { slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatPromptProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChatPromptProps, slots?: ChatPromptSlots }) => { const html = await ComponentRender(nameOrHtml, options, ChatPrompt) expect(html).toMatchSnapshot() }) diff --git a/test/components/Checkbox.spec.ts b/test/components/Checkbox.spec.ts index d06809b166..5349b75513 100644 --- a/test/components/Checkbox.spec.ts +++ b/test/components/Checkbox.spec.ts @@ -39,7 +39,7 @@ describe('Checkbox', () => { // Slots ['with label slot', { slots: { label: () => 'Label slot' } }], ['with description slot', { slots: { label: () => 'Description slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CheckboxProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CheckboxProps, slots?: CheckboxSlots }) => { const html = await ComponentRender(nameOrHtml, options, Checkbox) expect(html).toMatchSnapshot() }) diff --git a/test/components/CheckboxGroup.spec.ts b/test/components/CheckboxGroup.spec.ts index 356cbe435b..59f319523f 100644 --- a/test/components/CheckboxGroup.spec.ts +++ b/test/components/CheckboxGroup.spec.ts @@ -46,7 +46,7 @@ describe('CheckboxGroup', () => { ['with legend slot', { props, slots: { legend: () => 'Legend slot' } }], ['with label slot', { props, slots: { label: () => 'Label slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CheckboxGroupProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CheckboxGroupProps, slots?: CheckboxGroupSlots }) => { const html = await ComponentRender(nameOrHtml, options, CheckboxGroup) expect(html).toMatchSnapshot() }) diff --git a/test/components/Chip.spec.ts b/test/components/Chip.spec.ts index 27cfb7fd37..207f67d317 100644 --- a/test/components/Chip.spec.ts +++ b/test/components/Chip.spec.ts @@ -24,7 +24,7 @@ describe('Chip', () => { // Slots ['with default slot', { slots: { default: () => 'Default slot' } }], ['with content slot', { slots: { content: () => 'Content slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChipProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ChipProps, slots?: ChipSlots }) => { const html = await ComponentRender(nameOrHtml, options, Chip) expect(html).toMatchSnapshot() }) diff --git a/test/components/Collapsible.spec.ts b/test/components/Collapsible.spec.ts index ae004ed453..30066c745e 100644 --- a/test/components/Collapsible.spec.ts +++ b/test/components/Collapsible.spec.ts @@ -19,7 +19,7 @@ describe('Collapsible', () => { // Slots ['with default slot', { props, slots: { default: () => 'Default slot' } }], ['with content slot', { props, slots: { content: () => 'Content slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CollapsibleProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CollapsibleProps, slots?: CollapsibleSlots }) => { const html = await ComponentRender(nameOrHtml, options, Collapsible) expect(html).toMatchSnapshot() }) diff --git a/test/components/CommandPalette.spec.ts b/test/components/CommandPalette.spec.ts index 8881b28fc2..c090231c39 100644 --- a/test/components/CommandPalette.spec.ts +++ b/test/components/CommandPalette.spec.ts @@ -95,7 +95,7 @@ describe('CommandPalette', () => { ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }], ['with close slot', { props: { ...props, close: true }, slots: { close: () => 'Close slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CommandPaletteProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: CommandPaletteProps, slots?: CommandPaletteSlots }) => { const html = await ComponentRender(nameOrHtml, options, CommandPalette) expect(html).toMatchSnapshot() }) diff --git a/test/components/Container.spec.ts b/test/components/Container.spec.ts index 05fdc3474f..9cbf9fe43c 100644 --- a/test/components/Container.spec.ts +++ b/test/components/Container.spec.ts @@ -12,7 +12,7 @@ describe('Container', () => { ['with class', { props: { class: 'max-w-5xl' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContainerProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContainerProps, slots?: ContainerSlots }) => { const html = await ComponentRender(nameOrHtml, options, Container) expect(html).toMatchSnapshot() }) diff --git a/test/components/ContextMenu.spec.ts b/test/components/ContextMenu.spec.ts index e72551f604..b1fbc96b2d 100644 --- a/test/components/ContextMenu.spec.ts +++ b/test/components/ContextMenu.spec.ts @@ -98,7 +98,7 @@ describe('ContextMenu', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContextMenuProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContextMenuProps, slots?: ContextMenuSlots }) => { const wrapper = await mountSuspended(ContextMenuWrapper, options as any) await wrapper.find('span').trigger('click.right') diff --git a/test/components/DashboardGroup.spec.ts b/test/components/DashboardGroup.spec.ts index da5a890533..8efd1bc935 100644 --- a/test/components/DashboardGroup.spec.ts +++ b/test/components/DashboardGroup.spec.ts @@ -12,7 +12,7 @@ describe('DashboardGroup', () => { ['with class', { props: { class: 'inset-4' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DashboardGroupProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DashboardGroupProps, slots?: DashboardGroupSlots }) => { const html = await ComponentRender(nameOrHtml, options, DashboardGroup) expect(html).toMatchSnapshot() }) diff --git a/test/components/DashboardNavbar.spec.ts b/test/components/DashboardNavbar.spec.ts index bda472cf02..3cc9b73a15 100644 --- a/test/components/DashboardNavbar.spec.ts +++ b/test/components/DashboardNavbar.spec.ts @@ -4,12 +4,12 @@ import { axe } from 'vitest-axe' import { mountSuspended } from '@nuxt/test-utils/runtime' import DashboardGroup from '../../src/runtime/components/DashboardGroup.vue' import DashboardNavbar from '../../src/runtime/components/DashboardNavbar.vue' -import type { DashboardNavbarProps, DashboardNavbarSlots } from '../../src/runtime/components/DashboardNavbar.vue' +import type { DashboardNavbarProps } from '../../src/runtime/components/DashboardNavbar.vue' const DashboardWrapper = defineComponent({ components: { - UDashboardGroup: DashboardGroup as any, - UDashboardNavbar: DashboardNavbar as any + UDashboardGroup: DashboardGroup, + UDashboardNavbar: DashboardNavbar }, inheritAttrs: false, template: ` @@ -40,7 +40,7 @@ describe('DashboardNavbar', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with right slot', { slots: { right: () => 'Right slot' } }], ['with toggle slot', { slots: { toggle: () => 'Toggle slot' } }] - ])('renders %s correctly', async (_: string, options: { props?: DashboardNavbarProps, slots?: Partial }) => { + ])('renders %s correctly', async (_: string, options: { props?: DashboardNavbarProps, slots?: typeof DashboardWrapper['slots'] }) => { const wrapper = await mountSuspended(DashboardWrapper, options) expect(wrapper.html()).toMatchSnapshot() }) diff --git a/test/components/DashboardPanel.spec.ts b/test/components/DashboardPanel.spec.ts index db1d98e8e1..ef50a20a4c 100644 --- a/test/components/DashboardPanel.spec.ts +++ b/test/components/DashboardPanel.spec.ts @@ -4,12 +4,12 @@ import { axe } from 'vitest-axe' import { mountSuspended } from '@nuxt/test-utils/runtime' import DashboardGroup from '../../src/runtime/components/DashboardGroup.vue' import DashboardPanel from '../../src/runtime/components/DashboardPanel.vue' -import type { DashboardPanelProps, DashboardPanelSlots } from '../../src/runtime/components/DashboardPanel.vue' +import type { DashboardPanelProps } from '../../src/runtime/components/DashboardPanel.vue' const DashboardWrapper = defineComponent({ components: { - UDashboardGroup: DashboardGroup as any, - UDashboardPanel: DashboardPanel as any + UDashboardGroup: DashboardGroup, + UDashboardPanel: DashboardPanel }, inheritAttrs: false, template: ` @@ -37,7 +37,7 @@ describe('DashboardPanel', () => { ['with header slot', { slots: { header: () => 'Header slot' } }], ['with footer slot', { slots: { footer: () => 'Footer slot' } }], ['with resize-handle slot', { slots: { 'resize-handle': () => 'Resize handle slot' } }] - ])('renders %s correctly', async (_: string, options: { props?: DashboardPanelProps, slots?: Partial }) => { + ])('renders %s correctly', async (_: string, options: { props?: DashboardPanelProps, slots?: typeof DashboardWrapper['slots'] }) => { const wrapper = await mountSuspended(DashboardWrapper, options) expect(wrapper.html()).toMatchSnapshot() }) diff --git a/test/components/DashboardResizeHandle.spec.ts b/test/components/DashboardResizeHandle.spec.ts index 354864a0c6..adbb747807 100644 --- a/test/components/DashboardResizeHandle.spec.ts +++ b/test/components/DashboardResizeHandle.spec.ts @@ -4,12 +4,12 @@ import { axe } from 'vitest-axe' import { mountSuspended } from '@nuxt/test-utils/runtime' import DashboardGroup from '../../src/runtime/components/DashboardGroup.vue' import DashboardResizeHandle from '../../src/runtime/components/DashboardResizeHandle.vue' -import type { DashboardResizeHandleProps, DashboardResizeHandleSlots } from '../../src/runtime/components/DashboardResizeHandle.vue' +import type { DashboardResizeHandleProps } from '../../src/runtime/components/DashboardResizeHandle.vue' const DashboardWrapper = defineComponent({ components: { - UDashboardGroup: DashboardGroup as any, - UDashboardResizeHandle: DashboardResizeHandle as any + UDashboardGroup: DashboardGroup, + UDashboardResizeHandle: DashboardResizeHandle }, inheritAttrs: false, template: ` @@ -28,7 +28,7 @@ describe('DashboardResizeHandle', () => { ['with class', { props: { class: 'absolute' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (_: string, options: { props?: DashboardResizeHandleProps, slots?: Partial }) => { + ])('renders %s correctly', async (_: string, options: { props?: DashboardResizeHandleProps, slots?: typeof DashboardWrapper['slots'] }) => { const wrapper = await mountSuspended(DashboardWrapper, options) expect(wrapper.html()).toMatchSnapshot() }) diff --git a/test/components/DashboardSidebar.spec.ts b/test/components/DashboardSidebar.spec.ts index 4451a5e12c..d0772bba33 100644 --- a/test/components/DashboardSidebar.spec.ts +++ b/test/components/DashboardSidebar.spec.ts @@ -4,12 +4,12 @@ import { axe } from 'vitest-axe' import { mountSuspended } from '@nuxt/test-utils/runtime' import DashboardGroup from '../../src/runtime/components/DashboardGroup.vue' import DashboardSidebar from '../../src/runtime/components/DashboardSidebar.vue' -import type { DashboardSidebarProps, DashboardSidebarSlots } from '../../src/runtime/components/DashboardSidebar.vue' +import type { DashboardSidebarProps } from '../../src/runtime/components/DashboardSidebar.vue' const DashboardWrapper = defineComponent({ components: { - UDashboardGroup: DashboardGroup as any, - UDashboardSidebar: DashboardSidebar as any + UDashboardGroup: DashboardGroup, + UDashboardSidebar: DashboardSidebar }, inheritAttrs: false, template: ` @@ -47,7 +47,7 @@ describe('DashboardSidebar', () => { ['with toggle slot', { slots: { toggle: () => 'Toggle slot' } }], ['with content slot', { slots: { content: () => 'Content slot' } }], ['with resize-handle slot', { slots: { 'resize-handle': () => 'Resize handle slot' } }] - ])('renders %s correctly', async (_: string, options: { props?: DashboardSidebarProps, slots?: Partial }) => { + ])('renders %s correctly', async (_: string, options: { props?: DashboardSidebarProps, slots?: typeof DashboardWrapper['slots'] }) => { const wrapper = await mountSuspended(DashboardWrapper, options) expect(wrapper.html()).toMatchSnapshot() }) diff --git a/test/components/DashboardToolbar.spec.ts b/test/components/DashboardToolbar.spec.ts index 1b9d7b9d15..9d79391f16 100644 --- a/test/components/DashboardToolbar.spec.ts +++ b/test/components/DashboardToolbar.spec.ts @@ -15,7 +15,7 @@ describe('DashboardToolbar', () => { ['with default slot', { slots: { default: (): string => 'Default slot' } }], ['with left slot', { slots: { left: (): string => 'Left slot' } }], ['with right slot', { slots: { right: (): string => 'Right slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DashboardToolbarProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DashboardToolbarProps, slots?: DashboardToolbarSlots }) => { const html = await ComponentRender(nameOrHtml, options, DashboardToolbar) expect(html).toMatchSnapshot() }) diff --git a/test/components/Drawer.spec.ts b/test/components/Drawer.spec.ts index 892cf9d4cf..4870e422c2 100644 --- a/test/components/Drawer.spec.ts +++ b/test/components/Drawer.spec.ts @@ -29,7 +29,7 @@ describe('Drawer', () => { ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DrawerProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DrawerProps, slots?: DrawerSlots }) => { const html = await ComponentRender(nameOrHtml, options, Drawer) expect(html).toMatchSnapshot() }) diff --git a/test/components/DropdownMenu.spec.ts b/test/components/DropdownMenu.spec.ts index 6e289fa63c..ba020f24fe 100644 --- a/test/components/DropdownMenu.spec.ts +++ b/test/components/DropdownMenu.spec.ts @@ -110,7 +110,7 @@ describe('DropdownMenu', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DropdownMenuProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: DropdownMenuProps, slots?: DropdownMenuSlots }) => { const html = await ComponentRender(nameOrHtml, options, DropdownMenu) expect(html).toMatchSnapshot() }) diff --git a/test/components/Empty.spec.ts b/test/components/Empty.spec.ts index 4bf95ff669..4758e2b84b 100644 --- a/test/components/Empty.spec.ts +++ b/test/components/Empty.spec.ts @@ -37,7 +37,7 @@ describe('Empty', () => { ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with actions slot', { props, slots: { actions: () => 'Actions slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: EmptyProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: EmptyProps, slots?: EmptySlots }) => { const html = await ComponentRender(nameOrHtml, options, Empty) expect(html).toMatchSnapshot() }) diff --git a/test/components/Error.spec.ts b/test/components/Error.spec.ts index f62383f9a4..e704b4b991 100644 --- a/test/components/Error.spec.ts +++ b/test/components/Error.spec.ts @@ -28,7 +28,7 @@ describe('Error', () => { ['with statusMessage slot', { props, slots: { statusMessage: () => 'Status message slot' } }], ['with message slot', { props, slots: { message: () => 'Message slot' } }], ['with links slot', { props, slots: { links: () => 'Links slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ErrorProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ErrorProps, slots?: ErrorSlots }) => { const html = await ComponentRender(nameOrHtml, options, Error) expect(html).toMatchSnapshot() }) diff --git a/test/components/FieldGroup.spec.ts b/test/components/FieldGroup.spec.ts index 1b4f02f0b1..15649b574b 100644 --- a/test/components/FieldGroup.spec.ts +++ b/test/components/FieldGroup.spec.ts @@ -43,7 +43,7 @@ describe('FieldGroup', () => { } }] ) - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FieldGroupProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FieldGroupProps, slots?: FieldGroupSlots }) => { const html = await ComponentRender(nameOrHtml, options, FieldGroup) expect(html).toMatchSnapshot() }) diff --git a/test/components/FileUpload.spec.ts b/test/components/FileUpload.spec.ts index 84b3ea6e03..d1b13f5f96 100644 --- a/test/components/FileUpload.spec.ts +++ b/test/components/FileUpload.spec.ts @@ -86,7 +86,7 @@ describe('FileUpload', () => { ['with file-name slot', { props, slots: { 'file-name': () => 'File name slot' } }], ['with file-size slot', { props, slots: { 'file-size': () => 'File size slot' } }], ['with file-trailing slot', { props, slots: { 'file-trailing': () => 'File trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FileUploadProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FileUploadProps, slots?: FileUploadSlots }) => { const html = await ComponentRender(nameOrHtml, options, FileUpload) expect(html).toMatchSnapshot() }) diff --git a/test/components/Footer.spec.ts b/test/components/Footer.spec.ts index 44b9b6e82e..a8c2066251 100644 --- a/test/components/Footer.spec.ts +++ b/test/components/Footer.spec.ts @@ -17,7 +17,7 @@ describe('Footer', () => { ['with right slot', { slots: { right: () => 'Right slot' } }], ['with top slot', { slots: { top: () => 'Top slot' } }], ['with bottom slot', { slots: { bottom: () => 'Bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FooterProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FooterProps, slots?: FooterSlots }) => { const html = await ComponentRender(nameOrHtml, options, Footer) expect(html).toMatchSnapshot() }) diff --git a/test/components/FooterColumns.spec.ts b/test/components/FooterColumns.spec.ts index 2bb098f662..c8d85c6814 100644 --- a/test/components/FooterColumns.spec.ts +++ b/test/components/FooterColumns.spec.ts @@ -71,7 +71,7 @@ describe('FooterColumns', () => { ['with link-leading slot', { props, slots: { 'link-leading': () => 'Link leading slot' } }], ['with link-label slot', { props, slots: { 'link-label': () => 'Link label slot' } }], ['with link-trailing slot', { props, slots: { 'link-trailing': () => 'Link trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FooterColumnsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FooterColumnsProps, slots?: FooterColumnsSlots }) => { const html = await ComponentRender(nameOrHtml, options, FooterColumns) expect(html).toMatchSnapshot() }) diff --git a/test/components/Form.spec.ts b/test/components/Form.spec.ts index b54776b4ac..4156603fc6 100644 --- a/test/components/Form.spec.ts +++ b/test/components/Form.spec.ts @@ -16,7 +16,7 @@ describe('Form', () => { it.each([ ['with state', { props: { state: {} } }], ['with default slot', { props: { state: {} }, slots: { default: () => 'Form slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props: FormProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props: FormProps, slots?: FormSlots }) => { const html = await ComponentRender(nameOrHtml, options, UForm) expect(html).toMatchSnapshot() }) diff --git a/test/components/FormField.spec.ts b/test/components/FormField.spec.ts index feaef220fe..11ee5e39e2 100644 --- a/test/components/FormField.spec.ts +++ b/test/components/FormField.spec.ts @@ -80,7 +80,7 @@ describe('FormField', () => { ['with error slot', { slots: { error: () => 'Error slot' } }], ['with hint slot', { slots: { hint: () => 'Hint slot' } }], ['with help slot', { slots: { help: () => 'Help slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FormFieldProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: FormFieldProps, slots?: FormFieldSlots }) => { const html = await ComponentRender(nameOrHtml, options, FormFieldWrapper) expect(html).toMatchSnapshot() }) diff --git a/test/components/Header.spec.ts b/test/components/Header.spec.ts index 4694573078..827e1262b0 100644 --- a/test/components/Header.spec.ts +++ b/test/components/Header.spec.ts @@ -29,7 +29,7 @@ describe('Header', () => { ['with bottom slot', { slots: { bottom: () => 'Bottom slot' } }], ['with body slot', { slots: { body: () => 'Body slot' } }], ['with content slot', { slots: { content: () => 'Content slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: HeaderProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: HeaderProps, slots?: HeaderSlots }) => { const html = await ComponentRender(nameOrHtml, options, Header) expect(html).toMatchSnapshot() }) diff --git a/test/components/Input.spec.ts b/test/components/Input.spec.ts index 1ce15ce135..df2b3d7656 100644 --- a/test/components/Input.spec.ts +++ b/test/components/Input.spec.ts @@ -46,7 +46,7 @@ describe('Input', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with leading slot', { slots: { leading: () => 'Leading slot' } }], ['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputProps, slots?: InputSlots }) => { const html = await ComponentRender(nameOrHtml, options, Input) expect(html).toMatchSnapshot() }) diff --git a/test/components/InputMenu.spec.ts b/test/components/InputMenu.spec.ts index 44067bd90d..6fd05232c2 100644 --- a/test/components/InputMenu.spec.ts +++ b/test/components/InputMenu.spec.ts @@ -85,7 +85,7 @@ describe('InputMenu', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with create-item-label slot', { props: { ...props, searchTerm: 'New value', createItem: true }, slots: { 'create-item-label': () => 'Create item slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputMenuProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputMenuProps, slots?: InputMenuSlots }) => { const html = await ComponentRender(nameOrHtml, options, InputMenu) expect(html).toMatchSnapshot() }) diff --git a/test/components/InputNumber.spec.ts b/test/components/InputNumber.spec.ts index ff56016866..42f77b5ffa 100644 --- a/test/components/InputNumber.spec.ts +++ b/test/components/InputNumber.spec.ts @@ -34,7 +34,7 @@ describe('InputNumber', () => { // Slots ['with increment slot', { slots: { increment: () => '+' } }], ['with decrement slot', { slots: { decrement: () => '-' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputNumberProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputNumberProps, slots?: InputNumberSlots }) => { const html = await ComponentRender(nameOrHtml, options, InputNumber) expect(html).toMatchSnapshot() }) diff --git a/test/components/InputTags.spec.ts b/test/components/InputTags.spec.ts index 13baa12fca..cfe53395b0 100644 --- a/test/components/InputTags.spec.ts +++ b/test/components/InputTags.spec.ts @@ -38,7 +38,7 @@ describe('InputTags', () => { ['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }], ['with item-text slot', { slots: { ['item-text']: () => 'Item Text slot' } }], ['with item-delete slot', { slots: { ['item-delete']: () => 'Item Delete slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputTagsProps, slots?: Partial, attrs?: Record }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputTagsProps, slots?: InputTagsSlots, attrs?: Record }) => { const html = await ComponentRender(nameOrHtml, options, InputTags) expect(html).toMatchSnapshot() }) diff --git a/test/components/Kbd.spec.ts b/test/components/Kbd.spec.ts index 1fa369011e..46df3129e1 100644 --- a/test/components/Kbd.spec.ts +++ b/test/components/Kbd.spec.ts @@ -20,7 +20,7 @@ describe('Kbd', () => { ['with class', { props: { value: 'K', class: 'font-bold' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: KbdProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: KbdProps, slots?: KbdSlots }) => { const html = await ComponentRender(nameOrHtml, options, Kbd) expect(html).toMatchSnapshot() }) diff --git a/test/components/Link.spec.ts b/test/components/Link.spec.ts index f7c2d6a670..ece742bf13 100644 --- a/test/components/Link.spec.ts +++ b/test/components/Link.spec.ts @@ -20,7 +20,7 @@ describe('Link', () => { ['with class', { props: { class: 'font-medium' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: LinkProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: LinkProps, slots?: LinkSlots }) => { const html = await ComponentRender(nameOrHtml, options, Link) expect(html).toMatchSnapshot() }) diff --git a/test/components/Main.spec.ts b/test/components/Main.spec.ts index d9a4ce91d9..3bb37531dd 100644 --- a/test/components/Main.spec.ts +++ b/test/components/Main.spec.ts @@ -12,7 +12,7 @@ describe('Main', () => { ['with class', { props: { class: 'min-h-full' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: MainProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: MainProps, slots?: MainSlots }) => { const html = await ComponentRender(nameOrHtml, options, Main) expect(html).toMatchSnapshot() }) diff --git a/test/components/Marquee.spec.ts b/test/components/Marquee.spec.ts index f9b1e51182..9d80520cbc 100644 --- a/test/components/Marquee.spec.ts +++ b/test/components/Marquee.spec.ts @@ -18,7 +18,7 @@ describe('Marquee', () => { ['with ui', { props: { ui: { content: 'gap-4' } } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: MarqueeProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: MarqueeProps, slots?: MarqueeSlots }) => { const html = await ComponentRender(nameOrHtml, options, Marquee) expect(html).toMatchSnapshot() }) diff --git a/test/components/Modal.spec.ts b/test/components/Modal.spec.ts index f2358ddba9..c20b666469 100644 --- a/test/components/Modal.spec.ts +++ b/test/components/Modal.spec.ts @@ -30,7 +30,7 @@ describe('Modal', () => { ['with close slot', { props, slots: { close: () => 'Close slot' } }], ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ModalProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ModalProps, slots?: ModalSlots }) => { const html = await ComponentRender(nameOrHtml, options, Modal) expect(html).toMatchSnapshot() }) diff --git a/test/components/NavigationMenu.spec.ts b/test/components/NavigationMenu.spec.ts index d6bedbd518..c70cb829b0 100644 --- a/test/components/NavigationMenu.spec.ts +++ b/test/components/NavigationMenu.spec.ts @@ -111,7 +111,7 @@ describe('NavigationMenu', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: NavigationMenuProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: NavigationMenuProps, slots?: NavigationMenuSlots }) => { const html = await ComponentRender(nameOrHtml, options, NavigationMenu) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageAnchors.spec.ts b/test/components/PageAnchors.spec.ts index 08b87d8e48..b38c5409bc 100644 --- a/test/components/PageAnchors.spec.ts +++ b/test/components/PageAnchors.spec.ts @@ -39,7 +39,7 @@ describe('PageAnchors', () => { ['with link-leading slot', { props, slots: { 'link-leading': () => 'Link leading slot' } }], ['with link-label slot', { props, slots: { 'link-label': () => 'Link label slot' } }], ['with link-trailing slot', { props, slots: { 'link-trailing': () => 'Link trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageAnchorsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageAnchorsProps, slots?: PageAnchorsSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageAnchors) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageBody.spec.ts b/test/components/PageBody.spec.ts index 940114ac12..3144d45553 100644 --- a/test/components/PageBody.spec.ts +++ b/test/components/PageBody.spec.ts @@ -12,7 +12,7 @@ describe('PageBody', () => { ['with class', { props: { class: 'mt-12' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageBodyProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageBodyProps, slots?: PageBodySlots }) => { const html = await ComponentRender(nameOrHtml, options, PageBody) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageCTA.spec.ts b/test/components/PageCTA.spec.ts index 97728fc4bf..377587aada 100644 --- a/test/components/PageCTA.spec.ts +++ b/test/components/PageCTA.spec.ts @@ -32,7 +32,7 @@ describe('PageCTA', () => { ['with links slot', { slots: { links: () => 'Links slot' } }], ['with default slot', { slots: { default: () => 'Default slot' } }], ['with bottom slot', { slots: { bottom: () => 'Bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageCTAProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageCTAProps, slots?: PageCTASlots }) => { const html = await ComponentRender(nameOrHtml, options, PageCTA) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageCard.spec.ts b/test/components/PageCard.spec.ts index 311557944c..f58fbf7ab1 100644 --- a/test/components/PageCard.spec.ts +++ b/test/components/PageCard.spec.ts @@ -46,7 +46,7 @@ describe('PageCard', () => { ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }], ['with default slot', { props, slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageCardProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageCardProps, slots?: PageCardSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageCard) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageColumns.spec.ts b/test/components/PageColumns.spec.ts index 18ef36c19c..c4f2cdf8a5 100644 --- a/test/components/PageColumns.spec.ts +++ b/test/components/PageColumns.spec.ts @@ -12,7 +12,7 @@ describe('PageColumns', () => { ['with class', { props: { class: 'xl:columns-4' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageColumnsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageColumnsProps, slots?: PageColumnsSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageColumns) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageFeature.spec.ts b/test/components/PageFeature.spec.ts index c6edf1d0b0..30edccbff0 100644 --- a/test/components/PageFeature.spec.ts +++ b/test/components/PageFeature.spec.ts @@ -30,7 +30,7 @@ describe('PageFeature', () => { ['with title slot', { props, slots: { title: () => 'Title slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with default slot', { props, slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageFeatureProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageFeatureProps, slots?: PageFeatureSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageFeature) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageGrid.spec.ts b/test/components/PageGrid.spec.ts index 20c19c4950..8e69eaa420 100644 --- a/test/components/PageGrid.spec.ts +++ b/test/components/PageGrid.spec.ts @@ -12,7 +12,7 @@ describe('PageGrid', () => { ['with class', { props: { class: 'xl:grid-cols-4' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageGridProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageGridProps, slots?: PageGridSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageGrid) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageHeader.spec.ts b/test/components/PageHeader.spec.ts index e070a272d5..f303ddc8e5 100644 --- a/test/components/PageHeader.spec.ts +++ b/test/components/PageHeader.spec.ts @@ -21,7 +21,7 @@ describe('PageHeader', () => { ['with headline slot', { slots: { headline: () => 'Headline slot' } }], ['with links slot', { slots: { links: () => 'Links slot' } }], ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageHeaderProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageHeaderProps, slots?: PageHeaderSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageHeader) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageHero.spec.ts b/test/components/PageHero.spec.ts index e3e1ecf0aa..115a56913f 100644 --- a/test/components/PageHero.spec.ts +++ b/test/components/PageHero.spec.ts @@ -29,7 +29,7 @@ describe('PageHero', () => { ['with links slot', { slots: { links: () => 'Links slot' } }], ['with default slot', { slots: { default: () => 'Default slot' } }], ['with bottom slot', { slots: { bottom: () => 'Bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageHeroProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageHeroProps, slots?: PageHeroSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageHero) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageLinks.spec.ts b/test/components/PageLinks.spec.ts index 0e3b495242..667a59ee89 100644 --- a/test/components/PageLinks.spec.ts +++ b/test/components/PageLinks.spec.ts @@ -41,7 +41,7 @@ describe('PageLinks', () => { ['with link-leading slot', { props, slots: { 'link-leading': () => 'Link leading slot' } }], ['with link-label slot', { props, slots: { 'link-label': () => 'Link label slot' } }], ['with link-trailing slot', { props, slots: { 'link-trailing': () => 'Link trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageLinksProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageLinksProps, slots?: PageLinksSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageLinks) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageList.spec.ts b/test/components/PageList.spec.ts index 8b84439c3c..d18caa4b62 100644 --- a/test/components/PageList.spec.ts +++ b/test/components/PageList.spec.ts @@ -13,7 +13,7 @@ describe('PageList', () => { ['with class', { props: { class: 'gap-2' } }], // Slots ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageListProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageListProps, slots?: PageListSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageList) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageLogos.spec.ts b/test/components/PageLogos.spec.ts index b54d08da11..3298f8e7aa 100644 --- a/test/components/PageLogos.spec.ts +++ b/test/components/PageLogos.spec.ts @@ -21,7 +21,7 @@ describe('PageLogos', () => { // Slots ['with default slot', { slots: { default: () => 'Default slot' } }], ['with default slot', { slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageLogosProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageLogosProps, slots?: PageLogosSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageLogos) expect(html).toMatchSnapshot() }) diff --git a/test/components/PageSection.spec.ts b/test/components/PageSection.spec.ts index fb28f71293..0d0da92814 100644 --- a/test/components/PageSection.spec.ts +++ b/test/components/PageSection.spec.ts @@ -38,7 +38,7 @@ describe('PageSection', () => { ['with links slot', { slots: { links: () => 'Links slot' } }], ['with default slot', { slots: { default: () => 'Default slot' } }], ['with bottom slot', { slots: { bottom: () => 'Bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageSectionProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PageSectionProps, slots?: PageSectionSlots }) => { const html = await ComponentRender(nameOrHtml, options, PageSection) expect(html).toMatchSnapshot() }) diff --git a/test/components/Pagination.spec.ts b/test/components/Pagination.spec.ts index 6dfebc51a0..4732eb04e3 100644 --- a/test/components/Pagination.spec.ts +++ b/test/components/Pagination.spec.ts @@ -42,7 +42,7 @@ describe('Pagination', () => { ['with last slot', { props, slots: { last: () => 'Last slot' } }], ['with ellipsis slot', { props: { ...props, siblingCount: 1, showEdges: true, page: 5 }, slots: { ellipsis: () => 'Ellipsis slot' } }], ['with item slot', { props, slots: { item: () => 'Item slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PaginationProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PaginationProps, slots?: PaginationSlots }) => { const html = await ComponentRender(nameOrHtml, options, Pagination) expect(html).toMatchSnapshot() }) diff --git a/test/components/PricingPlan.spec.ts b/test/components/PricingPlan.spec.ts index 8dc0695a20..73a9ea6b62 100644 --- a/test/components/PricingPlan.spec.ts +++ b/test/components/PricingPlan.spec.ts @@ -66,7 +66,7 @@ describe('PricingPlan', () => { ['with header slot', { props, slots: { header: () => 'Header slot' } }], ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PricingPlanProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PricingPlanProps, slots?: PricingPlanSlots }) => { const html = await ComponentRender(nameOrHtml, options, PricingPlan) expect(html).toMatchSnapshot() }) diff --git a/test/components/PricingPlans.spec.ts b/test/components/PricingPlans.spec.ts index f8b54c04cc..970dd03207 100644 --- a/test/components/PricingPlans.spec.ts +++ b/test/components/PricingPlans.spec.ts @@ -35,7 +35,7 @@ describe('PricingPlans', () => { ['with class', { props: { ...props, class: 'gap-y-12' } }], // Slots ['with default slot', { props, slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PricingPlansProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: PricingPlansProps, slots?: PricingPlansSlots }) => { const html = await ComponentRender(nameOrHtml, options, PricingPlans) expect(html).toMatchSnapshot() }) diff --git a/test/components/PricingTable.spec.ts b/test/components/PricingTable.spec.ts index 6d6b096d83..26d49225b0 100644 --- a/test/components/PricingTable.spec.ts +++ b/test/components/PricingTable.spec.ts @@ -80,7 +80,7 @@ describe('PricingTable', () => { ['with tier-billing slot', { props, slots: { 'tier-billing': () => 'Tier billing slot' } }], ['with tier-discount slot', { props, slots: { 'tier-discount': () => 'Tier discount slot' } }], ['with tier-price slot', { props, slots: { 'tier-price': () => 'Tier price slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props: PricingTableProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props: PricingTableProps, slots?: PricingTableSlots }) => { const html = await ComponentRender(nameOrHtml, options, PricingTable) expect(html).toMatchSnapshot() }) diff --git a/test/components/Progress.spec.ts b/test/components/Progress.spec.ts index c1131df7f8..5658d81702 100644 --- a/test/components/Progress.spec.ts +++ b/test/components/Progress.spec.ts @@ -28,7 +28,7 @@ describe('Progress', () => { ['with ui', { props: { ui: { base: 'bg-default' } } }], // Slots ['with status slot', { slots: { status: () => 'Status slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ProgressProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ProgressProps, slots?: ProgressSlots }) => { const html = await ComponentRender(nameOrHtml, options, Progress) expect(html).toMatchSnapshot() }) diff --git a/test/components/RadioGroup.spec.ts b/test/components/RadioGroup.spec.ts index 51c3190624..e9fcba4adf 100644 --- a/test/components/RadioGroup.spec.ts +++ b/test/components/RadioGroup.spec.ts @@ -45,7 +45,7 @@ describe('RadioGroup', () => { ['with legend slot', { props, slots: { label: () => 'Legend slot' } }], ['with label slot', { props, slots: { label: () => 'Label slot' } }], ['with description slot', { props, slots: { label: () => 'Description slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: RadioGroupProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: RadioGroupProps, slots?: RadioGroupSlots }) => { const html = await ComponentRender(nameOrHtml, options, RadioGroup) expect(html).toMatchSnapshot() }) diff --git a/test/components/Select.spec.ts b/test/components/Select.spec.ts index 941c92a6e0..4e316b9409 100644 --- a/test/components/Select.spec.ts +++ b/test/components/Select.spec.ts @@ -81,7 +81,7 @@ describe('Select', () => { ['with item-leading slot', { props, slots: { 'item-leading': () => 'Item leading slot' } }], ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SelectProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SelectProps, slots?: SelectSlots }) => { const html = await ComponentRender(nameOrHtml, options, Select) expect(html).toMatchSnapshot() }) diff --git a/test/components/SelectMenu.spec.ts b/test/components/SelectMenu.spec.ts index 43b0f52865..60ad2a2f69 100644 --- a/test/components/SelectMenu.spec.ts +++ b/test/components/SelectMenu.spec.ts @@ -87,7 +87,7 @@ describe('SelectMenu', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with create-item-label slot', { props: { ...props, searchTerm: 'New value', createItem: true }, slots: { 'create-item-label': () => 'Create item slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SelectMenuProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SelectMenuProps, slots?: SelectMenuSlots }) => { const html = await ComponentRender(nameOrHtml, options, SelectMenu) expect(html).toMatchSnapshot() }) diff --git a/test/components/Separator.spec.ts b/test/components/Separator.spec.ts index 2010f48f57..b7c8b64a4c 100644 --- a/test/components/Separator.spec.ts +++ b/test/components/Separator.spec.ts @@ -23,7 +23,7 @@ describe('Separator', () => { ['with as', { props: { as: 'span' } }], ['with class', { props: { class: 'flex-row-reverse' } }], ['with ui', { props: { ui: { label: 'text-lg' } } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SeparatorProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SeparatorProps, slots?: SeparatorSlots }) => { const html = await ComponentRender(nameOrHtml, options, Separator) expect(html).toMatchSnapshot() }) diff --git a/test/components/Slideover.spec.ts b/test/components/Slideover.spec.ts index 1a60ba1378..03c2b10f30 100644 --- a/test/components/Slideover.spec.ts +++ b/test/components/Slideover.spec.ts @@ -32,7 +32,7 @@ describe('Slideover', () => { ['with close slot', { props, slots: { close: () => 'Close slot' } }], ['with body slot', { props, slots: { body: () => 'Body slot' } }], ['with footer slot', { props, slots: { footer: () => 'Footer slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SlideoverProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SlideoverProps, slots?: SlideoverSlots }) => { const html = await ComponentRender(nameOrHtml, options, Slideover) expect(html).toMatchSnapshot() }) diff --git a/test/components/Stepper.spec.ts b/test/components/Stepper.spec.ts index 9a5f84ccef..c1681bcd74 100644 --- a/test/components/Stepper.spec.ts +++ b/test/components/Stepper.spec.ts @@ -46,7 +46,7 @@ describe('Stepper', () => { ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with content slot', { props, slots: { content: () => 'Content slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: StepperProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: StepperProps, slots?: StepperSlots }) => { const html = await ComponentRender(nameOrHtml, options, Stepper) expect(html).toMatchSnapshot() }) diff --git a/test/components/Switch.spec.ts b/test/components/Switch.spec.ts index 33138fc8b7..1ade887210 100644 --- a/test/components/Switch.spec.ts +++ b/test/components/Switch.spec.ts @@ -36,7 +36,7 @@ describe('Switch', () => { // Slots ['with label slot', { slots: { label: () => 'Label slot' } }], ['with description slot', { slots: { label: () => 'Description slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SwitchProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: SwitchProps, slots?: SwitchSlots }) => { const html = await ComponentRender(nameOrHtml, options, Switch) expect(html).toMatchSnapshot() }) diff --git a/test/components/Table.spec.ts b/test/components/Table.spec.ts index 849f845a66..e9a0f52704 100644 --- a/test/components/Table.spec.ts +++ b/test/components/Table.spec.ts @@ -182,7 +182,7 @@ describe('Table', () => { ['with caption slot', { props, slots: { caption: () => 'Caption slot' } }], ['with body-top slot', { props, slots: { 'body-top': () => 'Body top slot' } }], ['with body-bottom slot', { props, slots: { 'body-bottom': () => 'Body bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TableProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TableProps, slots?: TableSlots }) => { const html = await ComponentRender(nameOrHtml, options, Table) expect(html).toMatchSnapshot() }) diff --git a/test/components/Tabs.spec.ts b/test/components/Tabs.spec.ts index a5abded715..ace38ef7f2 100644 --- a/test/components/Tabs.spec.ts +++ b/test/components/Tabs.spec.ts @@ -52,7 +52,7 @@ describe('Tabs', () => { ['with trailing slot', { props, slots: { trailing: () => 'Trailing slot' } }], ['with content slot', { props, slots: { content: () => 'Content slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TabsProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TabsProps, slots?: TabsSlots }) => { const html = await ComponentRender(nameOrHtml, options, Tabs) expect(html).toMatchSnapshot() }) diff --git a/test/components/Textarea.spec.ts b/test/components/Textarea.spec.ts index a538d8bc14..ce7acad399 100644 --- a/test/components/Textarea.spec.ts +++ b/test/components/Textarea.spec.ts @@ -46,7 +46,7 @@ describe('Textarea', () => { ['with default slot', { slots: { default: () => 'Default slot' } }], ['with leading slot', { slots: { leading: () => 'Leading slot' } }], ['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TextareaProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TextareaProps, slots?: TextareaSlots }) => { const html = await ComponentRender(nameOrHtml, options, Textarea) expect(html).toMatchSnapshot() }) diff --git a/test/components/Timeline.spec.ts b/test/components/Timeline.spec.ts index 91aa9a0277..fadcb01d0f 100644 --- a/test/components/Timeline.spec.ts +++ b/test/components/Timeline.spec.ts @@ -56,7 +56,7 @@ describe('Timeline', () => { ['with date slot', { props, slots: { date: () => 'Date slot' } }], ['with title slot', { props, slots: { title: () => 'Title slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TimelineProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: TimelineProps, slots?: TimelineSlots }) => { const html = await ComponentRender(nameOrHtml, options, Timeline) expect(html).toMatchSnapshot() }) diff --git a/test/components/Toast.spec.ts b/test/components/Toast.spec.ts index b212561096..7e35c427ab 100644 --- a/test/components/Toast.spec.ts +++ b/test/components/Toast.spec.ts @@ -50,7 +50,7 @@ describe('Toast', () => { ['with title slot', { props, slots: { title: () => 'Title slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with close slot', { props, slots: { close: () => 'Close slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ToastProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ToastProps, slots?: ToastSlots }) => { const html = await ComponentRender(nameOrHtml, options, ToastWrapper) expect(html).toMatchSnapshot() }) diff --git a/test/components/Tree.spec.ts b/test/components/Tree.spec.ts index 8c1166e59c..fc178c9139 100644 --- a/test/components/Tree.spec.ts +++ b/test/components/Tree.spec.ts @@ -71,7 +71,7 @@ describe('Tree', () => { ['with item-leading slot', { props, slots: { 'item-leading': () => 'leading slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'trailing slot' } }], ['with dynamic slot', { props, slots: { app: () => 'dynamic slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: Partial, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: Partial, slots?: TreeSlots }) => { const html = await ComponentRender(nameOrHtml, options, Tree) expect(html).toMatchSnapshot() }) diff --git a/test/components/User.spec.ts b/test/components/User.spec.ts index 580389dfd3..8e3ccadccd 100644 --- a/test/components/User.spec.ts +++ b/test/components/User.spec.ts @@ -33,7 +33,7 @@ describe('User', () => { ['with name slot', { props, slots: { name: () => 'Name slot' } }], ['with description slot', { props, slots: { description: () => 'Description slot' } }], ['with default slot', { props, slots: { default: () => 'Default slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: UserProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: UserProps, slots?: UserSlots }) => { const html = await ComponentRender(nameOrHtml, options, User) expect(html).toMatchSnapshot() }) diff --git a/test/components/content/ContentNavigation.spec.ts b/test/components/content/ContentNavigation.spec.ts index b54a17b321..fea147a3ed 100644 --- a/test/components/content/ContentNavigation.spec.ts +++ b/test/components/content/ContentNavigation.spec.ts @@ -68,7 +68,7 @@ describe('ContentNavigation', () => { ['with item-label slot', { props, slots: { 'item-label': () => 'Item label slot' } }], ['with item-trailing slot', { props, slots: { 'item-trailing': () => 'Item trailing slot' } }], ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentNavigationProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentNavigationProps, slots?: ContentNavigationSlots }) => { const html = await ComponentRender(nameOrHtml, options, ContentNavigation) expect(html).toMatchSnapshot() }) diff --git a/test/components/content/ContentSurround.spec.ts b/test/components/content/ContentSurround.spec.ts index b4752a5b13..7bf35768e3 100644 --- a/test/components/content/ContentSurround.spec.ts +++ b/test/components/content/ContentSurround.spec.ts @@ -28,7 +28,7 @@ describe('ContentSurround', () => { ['with link slot', { props, slots: { link: () => 'Link slot' } }], ['with link-leading slot', { props, slots: { 'link-leading': () => 'Link leading slot' } }], ['with link-title slot', { props, slots: { 'link-title': () => 'Link title slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentSurroundProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentSurroundProps, slots?: ContentSurroundSlots }) => { const html = await ComponentRender(nameOrHtml, options, ContentSurround) expect(html).toMatchSnapshot() }) diff --git a/test/components/content/ContentToc.spec.ts b/test/components/content/ContentToc.spec.ts index ed2e7683d5..67f66c56be 100644 --- a/test/components/content/ContentToc.spec.ts +++ b/test/components/content/ContentToc.spec.ts @@ -66,7 +66,7 @@ describe('ContentToc', () => { ['with link slot', { props, slots: { link: () => 'Link slot' } }], ['with top slot', { props, slots: { top: () => 'Top slot' } }], ['with bottom slot', { props, slots: { bottom: () => 'Bottom slot' } }] - ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentTocProps, slots?: Partial }) => { + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContentTocProps, slots?: ContentTocSlots }) => { const html = await ComponentRender(nameOrHtml, options, ContentToc) expect(html).toMatchSnapshot() }) diff --git a/test/utils/types.ts b/test/utils/types.ts index 8d91218276..49d471b841 100644 --- a/test/utils/types.ts +++ b/test/utils/types.ts @@ -18,7 +18,7 @@ export function expectSlotProps>(_name type Ctx = V extends { __ctx?: infer C } ? NonNullable : never type Slots = Ctx extends { slots: infer S } ? { - [K in keyof S as S[K] extends never ? never : K]: S[K] extends (props: infer P) => any ? P : never + [K in keyof Required as Required[K] extends never ? never : K]: Required[K] extends (props: infer P) => any ? P : never } : never type Events = Ctx extends { props: infer Props } ? {