@@ -16,7 +16,6 @@ export type NotificationProps = {
1616 alt ?: string ;
1717 icon ?: string ;
1818 iconSize ?: IconSize ;
19- alertTexture ?: boolean ;
2019 onClose ?: EventHandler < MouseEvent < HTMLButtonElement > > ;
2120} & HTMLAttributes < HTMLDivElement > ;
2221
@@ -26,7 +25,6 @@ export const Notification: FC<NotificationProps> = (props) => {
2625 type,
2726 level,
2827 alt,
29- alertTexture = true ,
3028 icon,
3129 iconSize = 'small' ,
3230 onClose,
@@ -46,16 +44,20 @@ export const Notification: FC<NotificationProps> = (props) => {
4644 'slds-notify' ,
4745 typeClassName ,
4846 levelClassName ,
49- alertTexture ? 'slds-theme_alert-texture' : null
47+ {
48+ [ `slds-alert_${ level } ` ] : type === 'alert' && level && level !== 'info' ,
49+ }
5050 ) ;
5151
5252 const iconEl = icon ? (
5353 < Icon
54- className = {
55- type === 'toast' ? 'slds-m-right_small' : 'slds-m-right_x-small'
56- }
54+ container = { true }
55+ containerClassName = { classnames (
56+ type === 'toast' ? 'slds-m-right_small' : 'slds-m-right_x-small' ,
57+ type === 'alert' ? [ 'slds-no-flex' , 'slds-align-top' ] : null
58+ ) }
5759 icon = { icon }
58- size = { iconSize }
60+ size = { iconSize ?? ( type === 'toast' ? 'small' : 'x-small' ) }
5961 fillColor = 'none'
6062 textColor = { level === 'warning' ? 'default' : null }
6163 />
@@ -65,27 +67,23 @@ export const Notification: FC<NotificationProps> = (props) => {
6567 < div className = { alertClassNames } role = 'alert' { ...pprops } >
6668 { alt ? < span className = 'slds-assistive-text' > { alt } </ span > : undefined }
6769 { onClose ? (
68- < Button
69- className = 'slds-notify__close'
70- type = 'icon-inverse'
71- icon = 'close'
72- iconSize = { type === 'toast' ? 'large' : 'small' }
73- alt = 'Close'
74- onClick = { onClose }
75- />
70+ < div className = 'slds-notify__close' >
71+ < Button
72+ type = 'icon-inverse'
73+ icon = 'close'
74+ size = { type === 'toast' ? undefined : 'small' }
75+ alt = 'Close'
76+ onClick = { onClose }
77+ />
78+ </ div >
7679 ) : undefined }
80+ { iconEl }
7781 { type === 'toast' ? (
78- < div className = 'slds-notify__content slds-grid' >
79- { iconEl }
80- < div className = 'slds-col slds-align-middle' >
81- < h2 className = 'slds-text-heading_small' > { children } </ h2 >
82- </ div >
82+ < div className = 'slds-notify__content' >
83+ < h2 className = 'slds-text-heading_small' > { children } </ h2 >
8384 </ div >
8485 ) : (
85- < h2 >
86- { iconEl }
87- { children }
88- </ h2 >
86+ < h2 > { children } </ h2 >
8987 ) }
9088 </ div >
9189 ) ;
0 commit comments