mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-26 09:50:33 +01:00
fix: remove IconProps usage
This commit is contained in:
@@ -4,7 +4,6 @@ import type { AccordionRootProps, AccordionRootEmits, AccordionContentProps } fr
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/accordion'
|
import theme from '#build/ui/accordion'
|
||||||
import type { IconProps } from '#ui/types'
|
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -12,8 +11,8 @@ const accordion = tv({ extend: tv(theme), ...(appConfig.ui?.accordion || {}) })
|
|||||||
|
|
||||||
export interface AccordionItem {
|
export interface AccordionItem {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
trailingIcon?: IconProps['name']
|
trailingIcon?: string
|
||||||
slot?: string
|
slot?: string
|
||||||
value?: string
|
value?: string
|
||||||
content?: string
|
content?: string
|
||||||
@@ -22,7 +21,7 @@ export interface AccordionItem {
|
|||||||
|
|
||||||
export interface AccordionProps<T> extends Omit<AccordionRootProps, 'asChild' | 'dir' | 'orientation'> {
|
export interface AccordionProps<T> extends Omit<AccordionRootProps, 'asChild' | 'dir' | 'orientation'> {
|
||||||
items?: T[]
|
items?: T[]
|
||||||
trailingIcon?: IconProps['name']
|
trailingIcon?: string
|
||||||
content?: Omit<AccordionContentProps, 'asChild'>
|
content?: Omit<AccordionContentProps, 'asChild'>
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof accordion.slots>
|
ui?: Partial<typeof accordion.slots>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { PrimitiveProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/alert'
|
import theme from '#build/ui/alert'
|
||||||
import type { AvatarProps, ButtonProps, IconProps } from '#ui/types'
|
import type { AvatarProps, ButtonProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ type AlertVariants = VariantProps<typeof alert>
|
|||||||
export interface AlertProps extends Omit<PrimitiveProps, 'asChild'> {
|
export interface AlertProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string | VNode | (() => VNode)
|
description?: string | VNode | (() => VNode)
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
color?: AlertVariants['color']
|
color?: AlertVariants['color']
|
||||||
variant?: AlertVariants['variant']
|
variant?: AlertVariants['variant']
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { AvatarFallbackProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/avatar'
|
import theme from '#build/ui/avatar'
|
||||||
import type { IconProps } from '#ui/types'
|
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { avatar: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { avatar: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -16,7 +15,7 @@ export interface AvatarProps extends Omit<AvatarFallbackProps, 'as' | 'asChild'>
|
|||||||
as?: string | object
|
as?: string | object
|
||||||
src?: string
|
src?: string
|
||||||
alt?: string
|
alt?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
text?: string
|
text?: string
|
||||||
size?: AvatarVariants['size']
|
size?: AvatarVariants['size']
|
||||||
class?: any
|
class?: any
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { PrimitiveProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/breadcrumb'
|
import theme from '#build/ui/breadcrumb'
|
||||||
import type { AvatarProps, IconProps, LinkProps } from '#ui/types'
|
import type { AvatarProps, LinkProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -12,14 +12,14 @@ const breadcrumb = tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb || {}) }
|
|||||||
|
|
||||||
export interface BreadcrumbItem extends LinkProps {
|
export interface BreadcrumbItem extends LinkProps {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
slot?: string
|
slot?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BreadcrumbProps<T> extends Omit<PrimitiveProps, 'asChild'> {
|
export interface BreadcrumbProps<T> extends Omit<PrimitiveProps, 'asChild'> {
|
||||||
items?: T[]
|
items?: T[]
|
||||||
separatorIcon?: IconProps['name']
|
separatorIcon?: string
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof breadcrumb.slots>
|
ui?: Partial<typeof breadcrumb.slots>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { CheckboxRootProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/checkbox'
|
import theme from '#build/ui/checkbox'
|
||||||
import type { IconProps } from '#ui/types'
|
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -17,9 +16,9 @@ export interface CheckboxProps extends Omit<CheckboxRootProps, 'asChild' | 'chec
|
|||||||
description?: string
|
description?: string
|
||||||
color?: CheckboxVariants['color']
|
color?: CheckboxVariants['color']
|
||||||
size?: CheckboxVariants['size']
|
size?: CheckboxVariants['size']
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
indeterminate?: boolean
|
indeterminate?: boolean
|
||||||
indeterminateIcon?: IconProps['name']
|
indeterminateIcon?: string
|
||||||
defaultValue?: boolean
|
defaultValue?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof checkbox.slots>
|
ui?: Partial<typeof checkbox.slots>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentP
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/dropdown-menu'
|
import theme from '#build/ui/dropdown-menu'
|
||||||
import type { AvatarProps, IconProps, KbdProps, LinkProps } from '#ui/types'
|
import type { AvatarProps, KbdProps, LinkProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ const dropdownMenu = tv({ extend: tv(theme), ...(appConfig.ui?.dropdownMenu || {
|
|||||||
|
|
||||||
export interface DropdownMenuItem extends Omit<LinkProps, 'type'> {
|
export interface DropdownMenuItem extends Omit<LinkProps, 'type'> {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
content?: Omit<DropdownMenuContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DropdownMenuContentProps, 'asChild' | 'forceMount'>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { NavigationMenuRootProps, NavigationMenuRootEmits } from 'radix-vue
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/navigation-menu'
|
import theme from '#build/ui/navigation-menu'
|
||||||
import type { AvatarProps, BadgeProps, IconProps, LinkProps, SeparatorProps } from '#ui/types'
|
import type { AvatarProps, BadgeProps, LinkProps, SeparatorProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const navigationMenu = tv({ extend: tv(theme), ...(appConfig.ui?.navigationMenu
|
|||||||
export interface NavigationMenuItem extends LinkProps {
|
export interface NavigationMenuItem extends LinkProps {
|
||||||
label?: string
|
label?: string
|
||||||
value?: string
|
value?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
badge?: string | number | BadgeProps
|
badge?: string | number | BadgeProps
|
||||||
slot?: string
|
slot?: string
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ import type { PaginationRootProps, PaginationRootEmits } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/pagination'
|
import theme from '#build/ui/pagination'
|
||||||
import type { ButtonProps, IconProps } from '#ui/types'
|
import type { ButtonProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
|
||||||
|
|
||||||
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
|
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
|
||||||
|
|
||||||
export interface PaginationProps extends Omit<PaginationRootProps, 'asChild'> {
|
export interface PaginationProps extends Omit<PaginationRootProps, 'asChild'> {
|
||||||
firstIcon?: IconProps['name']
|
firstIcon?: string
|
||||||
prevIcon?: IconProps['name']
|
prevIcon?: string
|
||||||
nextIcon?: IconProps['name']
|
nextIcon?: string
|
||||||
lastIcon?: IconProps['name']
|
lastIcon?: string
|
||||||
ellipsisIcon?: IconProps['name']
|
ellipsisIcon?: string
|
||||||
color?: ButtonProps['color']
|
color?: ButtonProps['color']
|
||||||
variant?: ButtonProps['variant']
|
variant?: ButtonProps['variant']
|
||||||
activeColor?: ButtonProps['color']
|
activeColor?: ButtonProps['color']
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { SwitchRootProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/switch'
|
import theme from '#build/ui/switch'
|
||||||
import type { IconProps } from '#ui/types'
|
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -16,9 +15,9 @@ export interface SwitchProps extends Omit<SwitchRootProps, 'asChild' | 'checked'
|
|||||||
color?: SwitchVariants['color']
|
color?: SwitchVariants['color']
|
||||||
size?: SwitchVariants['size']
|
size?: SwitchVariants['size']
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
loadingIcon?: IconProps['name']
|
loadingIcon?: string
|
||||||
checkedIcon?: IconProps['name']
|
checkedIcon?: string
|
||||||
uncheckedIcon?: IconProps['name']
|
uncheckedIcon?: string
|
||||||
label?: string
|
label?: string
|
||||||
description?: string
|
description?: string
|
||||||
defaultValue?: boolean
|
defaultValue?: boolean
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { TabsRootProps, TabsRootEmits, TabsContentProps } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/tabs'
|
import theme from '#build/ui/tabs'
|
||||||
import type { IconProps, AvatarProps } from '#ui/types'
|
import type { AvatarProps } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ const tabs = tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {}) })
|
|||||||
|
|
||||||
export interface TabsItem {
|
export interface TabsItem {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
slot?: string
|
slot?: string
|
||||||
value?: string
|
value?: string
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { ToastRootProps, ToastRootEmits } from 'radix-vue'
|
|||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
import theme from '#build/ui/toast'
|
import theme from '#build/ui/toast'
|
||||||
import type { AvatarProps, ButtonProps, IconProps, ToasterContext } from '#ui/types'
|
import type { AvatarProps, ButtonProps, ToasterContext } from '#ui/types'
|
||||||
|
|
||||||
const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
|
const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ type ToastVariants = VariantProps<typeof toast>
|
|||||||
export interface ToastProps extends Omit<ToastRootProps, 'asChild' | 'forceMount'> {
|
export interface ToastProps extends Omit<ToastRootProps, 'asChild' | 'forceMount'> {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string | VNode | (() => VNode)
|
description?: string | VNode | (() => VNode)
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
color?: ToastVariants['color']
|
color?: ToastVariants['color']
|
||||||
actions?: ButtonProps[]
|
actions?: ButtonProps[]
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useAppConfig } from '#imports'
|
import { useAppConfig } from '#imports'
|
||||||
import type { IconProps } from '#ui/types'
|
|
||||||
|
|
||||||
export interface UseComponentIconsProps {
|
export interface UseComponentIconsProps {
|
||||||
icon?: IconProps['name']
|
icon?: string
|
||||||
leading?: boolean
|
leading?: boolean
|
||||||
leadingIcon?: IconProps['name']
|
leadingIcon?: string
|
||||||
trailing?: boolean
|
trailing?: boolean
|
||||||
trailingIcon?: IconProps['name']
|
trailingIcon?: string
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
loadingIcon?: IconProps['name']
|
loadingIcon?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useComponentIcons(props: UseComponentIconsProps) {
|
export function useComponentIcons(props: UseComponentIconsProps) {
|
||||||
|
|||||||
Reference in New Issue
Block a user