From 064e928d1afca5a3e07d900b10294269b0406355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A8re=20Pique?= Date: Mon, 11 Aug 2025 16:16:33 +0200 Subject: [PATCH] feat(Alert.tsx): add custom role, status or alert --- src/Alert.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Alert.tsx b/src/Alert.tsx index 8685dc1a..0692cd4c 100644 --- a/src/Alert.tsx +++ b/src/Alert.tsx @@ -32,6 +32,7 @@ export type AlertProps = { closable?: boolean; /** To provide if you want the Alert to be controlled */ isClosed?: boolean; + role?: "alert" | "status"; onClose?: () => void; } & (AlertProps.DefaultSize | AlertProps.Small); @@ -73,6 +74,7 @@ export const Alert = memo( closable: isClosableByUser = false, isClosed: props_isClosed, onClose, + role = "alert", ...rest } = props; @@ -145,7 +147,7 @@ export const Alert = memo( className )} style={style} - {...(refShouldSetRole.current && { "role": "alert" })} + {...(refShouldSetRole.current && { "role": role })} ref={ref} {...rest} >