From df2379eefeb0e09f51792d5758222a4f06b7a02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Wed, 18 Feb 2026 13:52:57 +0100 Subject: [PATCH] nicolium: add aria-labelledby for widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/components/ui/widget.tsx | 44 +++++++++++---------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/pl-fe/src/components/ui/widget.tsx b/packages/pl-fe/src/components/ui/widget.tsx index d2b18971c..44b2d7306 100644 --- a/packages/pl-fe/src/components/ui/widget.tsx +++ b/packages/pl-fe/src/components/ui/widget.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import React from 'react'; +import React, { useMemo } from 'react'; import IconButton from '@/components/ui/icon-button'; @@ -26,24 +26,28 @@ const Widget: React.FC = ({ actionTitle, action, className, -}): JSX.Element => ( -
- {(title ?? action ?? onActionClick) && ( -
- {title &&

{title}

} - {action ?? - (onActionClick && ( - - ))} -
- )} -
{children}
-
-); +}): JSX.Element => { + const widgetId = useMemo(() => crypto.randomUUID(), []); + + return ( +
+ {(title ?? action ?? onActionClick) && ( +
+ {title &&

{title}

} + {action ?? + (onActionClick && ( + + ))} +
+ )} +
{children}
+
+ ); +}; export { Widget as default };