From cc41ac793644210c3d5a1efa5eca0d4b9adc300f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 6 May 2026 23:39:02 +0800 Subject: [PATCH] support list semantic styles --- src/NotificationList/index.tsx | 5 ++++- tests/index.test.tsx | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/NotificationList/index.tsx b/src/NotificationList/index.tsx index 2063828..472519f 100644 --- a/src/NotificationList/index.tsx +++ b/src/NotificationList/index.tsx @@ -24,10 +24,12 @@ export interface NotificationListConfig extends Omit = (props) => { `${prefixCls}-${placement}`, contextClassNames?.list, className, + classNames?.list, { [`${prefixCls}-stack`]: stackEnabled, [`${prefixCls}-stack-expanded`]: expanded, @@ -251,7 +254,7 @@ const NotificationList: React.FC = (props) => { onMouseLeave={() => { setListHovering(false); }} - style={style} + style={{ ...styles?.list, ...style }} > { expect(document.querySelector('.bamboo-topRight')).toBeTruthy(); }); - it('should listContent styles and classNames work', () => { + it('should list and listContent styles and classNames work', () => { const { instance } = renderDemo({ classNames: { + list: 'root-list', listContent: 'bamboo', }, styles: { + list: { + content: 'root-list', + }, listContent: { content: 'little', }, @@ -860,6 +864,10 @@ describe('Notification.Basic', () => { instance.open({}); }); + expect(document.querySelector('.rc-notification-list')).toHaveStyle({ + content: 'root-list', + }); + expect(document.querySelector('.rc-notification-list')).toHaveClass('root-list'); expect(document.querySelector('.rc-notification-list-content')).toHaveStyle({ content: 'little', });