@@ -21,49 +21,61 @@ export interface NotificationStyles {
2121}
2222
2323export interface NotificationProps {
24+ // Style
2425 prefixCls ?: string ;
26+ className ?: string ;
27+ style ?: React . CSSProperties ;
28+ classNames ?: NotificationClassNames ;
29+ styles ?: NotificationStyles ;
30+
31+ // UI
2532 content ?: React . ReactNode ;
2633 actions ?: React . ReactNode ;
2734 close ?: React . ReactNode ;
2835 closable ?:
2936 | boolean
3037 | ( { closeIcon ?: React . ReactNode ; onClose ?: VoidFunction } & React . AriaAttributes ) ;
31- duration ?: number | false | null ;
32- showProgress ?: boolean ;
33- times ?: number ;
34- hovering ?: boolean ;
3538 offset ?: {
3639 x : number ;
3740 y : number ;
3841 } ;
42+
43+ // Behavior
44+ duration ?: number | false | null ;
45+ showProgress ?: boolean ;
46+ times ?: number ;
47+ hovering ?: boolean ;
3948 pauseOnHover ?: boolean ;
40- className ?: string ;
41- style ?: React . CSSProperties ;
42- classNames ?: NotificationClassNames ;
43- styles ?: NotificationStyles ;
44- props ?: React . HTMLAttributes < HTMLDivElement > & Record < string , any > ;
49+
50+ // Function
4551 onClick ?: React . MouseEventHandler < HTMLDivElement > ;
4652 onClose ?: ( ) => void ;
4753 onCloseInternal ?: VoidFunction ;
4854}
4955
5056const Notification = React . forwardRef < HTMLDivElement , NotificationProps > ( ( props , ref ) => {
5157 const {
58+ // Style
5259 prefixCls = 'rc-notification' ,
60+ className,
61+ style,
62+ classNames,
63+ styles,
64+
65+ // UI
5366 content,
5467 actions,
5568 close,
5669 closable,
70+ offset,
71+
72+ // Behavior
5773 duration = 4.5 ,
5874 showProgress,
5975 hovering : forcedHovering ,
60- offset,
6176 pauseOnHover = true ,
62- className,
63- style,
64- classNames,
65- styles,
66- props : divProps ,
77+
78+ // Function
6779 onClick,
6880 onClose,
6981 onCloseInternal,
@@ -121,8 +133,9 @@ const Notification = React.forwardRef<HTMLDivElement, NotificationProps>((props,
121133 // ========================= Render =========================
122134 return (
123135 < div
124- { ...divProps }
136+ { ...rootProps }
125137 ref = { ref }
138+ // Styles
126139 className = { clsx ( noticePrefixCls , className , classNames ?. root , {
127140 [ `${ noticePrefixCls } -closable` ] : mergedClosable ,
128141 } ) }
@@ -136,20 +149,21 @@ const Notification = React.forwardRef<HTMLDivElement, NotificationProps>((props,
136149 : null ) ,
137150 ...style ,
138151 } }
152+ // Events
139153 onClick = { onClick }
140154 onMouseEnter = { ( event ) => {
141155 setHovering ( true ) ;
142156 if ( pauseOnHover ) {
143157 onPause ( ) ;
144158 }
145- divProps ?. onMouseEnter ?.( event ) ;
159+ rootProps ?. onMouseEnter ?.( event ) ;
146160 } }
147161 onMouseLeave = { ( event ) => {
148162 setHovering ( false ) ;
149163 if ( pauseOnHover && ! forcedHovering ) {
150164 onResume ( ) ;
151165 }
152- divProps ?. onMouseLeave ?.( event ) ;
166+ rootProps ?. onMouseLeave ?.( event ) ;
153167 } }
154168 >
155169 < div
0 commit comments