mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(Alert/Toast): remove description as VNode
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { isVNode, type VNode } from 'vue'
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { PrimitiveProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
@@ -15,7 +14,7 @@ type AlertVariants = VariantProps<typeof alert>
|
||||
|
||||
export interface AlertProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||
title?: string
|
||||
description?: string | VNode | (() => VNode)
|
||||
description?: string
|
||||
icon?: string
|
||||
avatar?: AvatarProps
|
||||
color?: AlertVariants['color']
|
||||
@@ -88,8 +87,7 @@ const ui = computed(() => tv({ extend: alert, slots: props.ui })({
|
||||
</slot>
|
||||
</div>
|
||||
<template v-if="description || !!slots.description">
|
||||
<component :is="description" v-if="description && isVNode(description)" />
|
||||
<div v-else :class="ui.description()">
|
||||
<div :class="ui.description()">
|
||||
<slot name="description">
|
||||
{{ description }}
|
||||
</slot>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { isVNode, type VNode } from 'vue'
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { ToastRootProps, ToastRootEmits } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
@@ -15,7 +14,7 @@ type ToastVariants = VariantProps<typeof toast>
|
||||
|
||||
export interface ToastProps extends Omit<ToastRootProps, 'asChild' | 'forceMount'> {
|
||||
title?: string
|
||||
description?: string | VNode | (() => VNode)
|
||||
description?: string
|
||||
icon?: string
|
||||
avatar?: AvatarProps
|
||||
color?: ToastVariants['color']
|
||||
@@ -109,8 +108,7 @@ defineExpose({
|
||||
</slot>
|
||||
</ToastTitle>
|
||||
<template v-if="description || !!slots.description">
|
||||
<ToastDescription v-if="description && isVNode(description)" :as="description" />
|
||||
<ToastDescription v-else :class="ui.description()">
|
||||
<ToastDescription :class="ui.description()">
|
||||
<slot name="description">
|
||||
{{ description }}
|
||||
</slot>
|
||||
|
||||
Reference in New Issue
Block a user