Skip to content

Commit 67e36ea

Browse files
committed
feat(*): allow passing a component instead of an icon name in all components
1 parent e0dcd1c commit 67e36ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+188
-176
lines changed

src/runtime/components/Accordion.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import type { AccordionRootProps, AccordionRootEmits } from 'reka-ui'
44
import type { AppConfig } from '@nuxt/schema'
55
import theme from '#build/ui/accordion'
6+
import type { IconProps } from '../types'
67
import type { DynamicSlots } from '../types/utils'
78
import type { ComponentConfig } from '../types/tv'
89
@@ -13,11 +14,11 @@ export interface AccordionItem {
1314
/**
1415
* @IconifyIcon
1516
*/
16-
icon?: string
17+
icon?: IconProps['name']
1718
/**
1819
* @IconifyIcon
1920
*/
20-
trailingIcon?: string
21+
trailingIcon?: IconProps['name']
2122
slot?: string
2223
content?: string
2324
/** A unique value for the accordion item. Defaults to the index. */
@@ -40,7 +41,7 @@ export interface AccordionProps<T extends AccordionItem = AccordionItem> extends
4041
* @defaultValue appConfig.ui.icons.chevronDown
4142
* @IconifyIcon
4243
*/
43-
trailingIcon?: string
44+
trailingIcon?: IconProps['name']
4445
/**
4546
* The key used to get the label from the item.
4647
* @defaultValue 'label'

src/runtime/components/Alert.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/alert'
4-
import type { AvatarProps, ButtonProps } from '../types'
4+
import type { AvatarProps, ButtonProps, IconProps } from '../types'
55
import type { ComponentConfig } from '../types/tv'
66
77
type Alert = ComponentConfig<typeof theme, AppConfig, 'alert'>
@@ -17,7 +17,7 @@ export interface AlertProps {
1717
/**
1818
* @IconifyIcon
1919
*/
20-
icon?: string
20+
icon?: IconProps['name']
2121
avatar?: AvatarProps
2222
/**
2323
* @defaultValue 'primary'
@@ -51,7 +51,7 @@ export interface AlertProps {
5151
* @defaultValue appConfig.ui.icons.close
5252
* @IconifyIcon
5353
*/
54-
closeIcon?: string
54+
closeIcon?: IconProps['name']
5555
class?: any
5656
ui?: Alert['slots']
5757
}

src/runtime/components/AuthForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<script lang="ts">
33
import type { AppConfig } from '@nuxt/schema'
44
import theme from '#build/ui/auth-form'
5-
import type { ButtonProps, FormProps, FormFieldProps, SeparatorProps, PinInputProps } from '../types'
5+
import type { ButtonProps, FormProps, FormFieldProps, SeparatorProps, PinInputProps, IconProps } from '../types'
66
import type { FormSchema, FormSubmitEvent, InferInput } from '../types/form'
77
import type { ComponentConfig } from '../types/tv'
88
@@ -29,7 +29,7 @@ export interface AuthFormProps<T extends FormSchema = FormSchema<object>, F exte
2929
* The icon displayed above the title.
3030
* @IconifyIcon
3131
*/
32-
icon?: string
32+
icon?: IconProps['name']
3333
title?: string
3434
description?: string
3535
fields?: F[]

src/runtime/components/Avatar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/avatar'
4-
import type { ChipProps } from '../types'
4+
import type { ChipProps, IconProps } from '../types'
55
import type { ComponentConfig } from '../types/tv'
66
77
type Avatar = ComponentConfig<typeof theme, AppConfig, 'avatar'>
@@ -17,7 +17,7 @@ export interface AvatarProps {
1717
/**
1818
* @IconifyIcon
1919
*/
20-
icon?: string
20+
icon?: IconProps['name']
2121
text?: string
2222
/**
2323
* @defaultValue 'md'

src/runtime/components/Banner.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/banner'
4-
import type { ButtonProps, LinkProps } from '../types'
4+
import type { ButtonProps, IconProps, LinkProps } from '../types'
55
import type { ComponentConfig } from '../types/tv'
66
77
type Banner = ComponentConfig<typeof theme, AppConfig, 'banner'>
@@ -22,7 +22,7 @@ export interface BannerProps {
2222
* The icon displayed next to the title.
2323
* @IconifyIcon
2424
*/
25-
icon?: string
25+
icon?: IconProps['name']
2626
title?: string
2727
/**
2828
* Display a list of actions next to the title.
@@ -47,7 +47,7 @@ export interface BannerProps {
4747
* @defaultValue appConfig.ui.icons.close
4848
* @IconifyIcon
4949
*/
50-
closeIcon?: string
50+
closeIcon?: IconProps['name']
5151
class?: any
5252
ui?: Banner['slots']
5353
}

src/runtime/components/Breadcrumb.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<script lang="ts">
33
import type { AppConfig } from '@nuxt/schema'
44
import theme from '#build/ui/breadcrumb'
5-
import type { AvatarProps, LinkProps } from '../types'
5+
import type { AvatarProps, IconProps, LinkProps } from '../types'
66
import type { DynamicSlots } from '../types/utils'
77
import type { ComponentConfig } from '../types/tv'
88
@@ -13,7 +13,7 @@ export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
1313
/**
1414
* @IconifyIcon
1515
*/
16-
icon?: string
16+
icon?: IconProps['name']
1717
avatar?: AvatarProps
1818
slot?: string
1919
class?: any
@@ -33,7 +33,7 @@ export interface BreadcrumbProps<T extends BreadcrumbItem = BreadcrumbItem> {
3333
* @defaultValue appConfig.ui.icons.chevronRight
3434
* @IconifyIcon
3535
*/
36-
separatorIcon?: string
36+
separatorIcon?: IconProps['name']
3737
/**
3838
* The key used to get the label from the item.
3939
* @defaultValue 'label'

src/runtime/components/Calendar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, Rang
33
import type { DateValue } from '@internationalized/date'
44
import type { AppConfig } from '@nuxt/schema'
55
import theme from '#build/ui/calendar'
6-
import type { ButtonProps } from '../types'
6+
import type { ButtonProps, IconProps } from '../types'
77
import type { ComponentConfig } from '../types/tv'
88
99
type Calendar = ComponentConfig<typeof theme, AppConfig, 'calendar'>
@@ -33,7 +33,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
3333
* @defaultValue appConfig.ui.icons.chevronDoubleRight
3434
* @IconifyIcon
3535
*/
36-
nextYearIcon?: string
36+
nextYearIcon?: IconProps['name']
3737
/**
3838
* Configure the next year button.
3939
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
@@ -44,7 +44,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
4444
* @defaultValue appConfig.ui.icons.chevronRight
4545
* @IconifyIcon
4646
*/
47-
nextMonthIcon?: string
47+
nextMonthIcon?: IconProps['name']
4848
/**
4949
* Configure the next month button.
5050
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
@@ -55,7 +55,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
5555
* @defaultValue appConfig.ui.icons.chevronDoubleLeft
5656
* @IconifyIcon
5757
*/
58-
prevYearIcon?: string
58+
prevYearIcon?: IconProps['name']
5959
/**
6060
* Configure the prev year button.
6161
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
@@ -66,7 +66,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
6666
* @defaultValue appConfig.ui.icons.chevronLeft
6767
* @IconifyIcon
6868
*/
69-
prevMonthIcon?: string
69+
prevMonthIcon?: IconProps['name']
7070
/**
7171
* Configure the prev month button.
7272
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}

src/runtime/components/Carousel.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { ClassNamesOptionsType } from 'embla-carousel-class-names'
1010
import type { FadeOptionsType } from 'embla-carousel-fade'
1111
import type { WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures'
1212
import theme from '#build/ui/carousel'
13-
import type { ButtonProps } from '../types'
13+
import type { ButtonProps, IconProps } from '../types'
1414
import type { ComponentConfig } from '../types/tv'
1515
1616
type Carousel = ComponentConfig<typeof theme, AppConfig, 'carousel'>
@@ -39,7 +39,7 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Om
3939
* @defaultValue appConfig.ui.icons.arrowLeft
4040
* @IconifyIcon
4141
*/
42-
prevIcon?: string
42+
prevIcon?: IconProps['name']
4343
/**
4444
* Configure the next button when arrows are enabled.
4545
* @defaultValue { size: 'md', color: 'neutral', variant: 'link' }
@@ -50,7 +50,7 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Om
5050
* @defaultValue appConfig.ui.icons.arrowRight
5151
* @IconifyIcon
5252
*/
53-
nextIcon?: string
53+
nextIcon?: IconProps['name']
5454
/**
5555
* Display prev and next buttons to scroll the carousel.
5656
* @defaultValue false

src/runtime/components/ChatMessage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { AppConfig } from '@nuxt/schema'
33
import type { UIMessage } from 'ai'
44
import theme from '#build/ui/chat-message'
5-
import type { AvatarProps, ButtonProps } from '../types'
5+
import type { AvatarProps, ButtonProps, IconProps } from '../types'
66
import type { ComponentConfig } from '../types/tv'
77
88
type ChatMessage = ComponentConfig<typeof theme, AppConfig, 'chatMessage'>
@@ -16,7 +16,7 @@ export interface ChatMessageProps extends UIMessage {
1616
/**
1717
* @IconifyIcon
1818
*/
19-
icon?: string
19+
icon?: IconProps['name']
2020
avatar?: AvatarProps & { [key: string]: any }
2121
/**
2222
* @defaultValue 'naked'

src/runtime/components/ChatMessages.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { AppConfig } from '@nuxt/schema'
33
import type { UIMessage, ChatStatus } from 'ai'
44
import theme from '#build/ui/chat-messages'
5-
import type { ButtonProps, ChatMessageProps } from '../types'
5+
import type { ButtonProps, ChatMessageProps, IconProps } from '../types'
66
import type { ComponentConfig } from '../types/tv'
77
88
type ChatMessages = ComponentConfig<typeof theme, AppConfig, 'chatMessages'>
@@ -31,7 +31,7 @@ export interface ChatMessagesProps {
3131
* @defaultValue appConfig.ui.icons.arrowDown
3232
* @IconifyIcon
3333
*/
34-
autoScrollIcon?: string
34+
autoScrollIcon?: IconProps['name']
3535
/**
3636
* The `user` messages props.
3737
* `{ side: 'right', variant: 'soft' }`{lang="ts-type"}

0 commit comments

Comments
 (0)