fix(avatar): title type in Avatar (#4529)

* fix(avatar): title type in Avatar

* fix(alert): apply isEmpty check on title

* fix(alert): alert interface props type
This commit is contained in:
աӄա 2025-01-13 11:41:05 +08:00 committed by GitHub
parent cfff127464
commit fcdf24a019
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/alert": patch
---
fix title type in Avatar (#4525)

View File

@ -138,7 +138,7 @@ Alert has the following slots:
data={[
{
attribute: "title",
type: "string",
type: "ReactNode",
description: "The alert title",
default: "-"
},

View File

@ -62,7 +62,7 @@ const Alert = forwardRef<"div", AlertProps>((props, ref) => {
{customIcon || <IconComponent {...getAlertIconProps()} />}
</div>
<div {...getMainWrapperProps()}>
{title && <div {...getTitleProps()}>{title}</div>}
{!isEmpty(title) && <div {...getTitleProps()}>{title}</div>}
{!isEmpty(description) && <div {...getDescriptionProps()}>{description}</div>}
{children}
</div>

View File

@ -9,7 +9,7 @@ import {alert} from "@nextui-org/theme";
import {useControlledState} from "@react-stately/utils";
import {clsx, dataAttr, isEmpty, objectToDeps} from "@nextui-org/shared-utils";
interface Props extends HTMLNextUIProps<"div"> {
interface Props extends Omit<HTMLNextUIProps<"div">, "title"> {
/**
* Ref to the DOM node.
*/
@ -17,7 +17,7 @@ interface Props extends HTMLNextUIProps<"div"> {
/**
* title of the alert message
*/
title?: string;
title?: ReactNode;
/**
* description of the alert message
*/