(frontend) implement persistent notifications for waiting participants

Add special non-closing notifications for waiting participants that remain
visible until all have been reviewed. Implement complementary system alongside
existing toaster notifications.

Designed with accessibility in mind but would benefit from expert review.
Current UX provides good foundation with quick actions planned for v2.
This commit is contained in:
lebaudantoine
2025-02-23 00:13:18 +01:00
committed by aleb_the_flash
parent 92851b10cc
commit e535040ac6
7 changed files with 139 additions and 7 deletions
+15 -2
View File
@@ -26,6 +26,11 @@ const avatar = cva({
height: '100%',
},
},
notification: {
true: {
border: '2px solid white',
},
},
},
defaultVariants: {
context: 'list',
@@ -37,14 +42,22 @@ export type AvatarProps = React.HTMLAttributes<HTMLDivElement> & {
bgColor?: string
} & RecipeVariantProps<typeof avatar>
export const Avatar = ({ name, bgColor, context, ...props }: AvatarProps) => {
export const Avatar = ({
name,
bgColor,
context,
notification,
style,
...props
}: AvatarProps) => {
const initial = name?.trim()?.charAt(0) || ''
return (
<div
style={{
backgroundColor: bgColor,
...style,
}}
className={avatar({ context })}
className={avatar({ context, notification })}
{...props}
>
{initial}