@@ -10,6 +10,7 @@ import {
1010 InformationOutlineCurrentIcon as InfoIcon ,
1111 AlertOutlineCurrentIcon as WarningIcon ,
1212 ErrorOutlineCurrentIcon as ErrorIcon ,
13+ InformationOutlineBlueIcon ,
1314} from '../Icons' ;
1415import classNames from 'classnames' ;
1516import { useFtlMsgResolver } from '../../models' ;
@@ -23,31 +24,45 @@ export const Banner = ({
2324 animation,
2425 dismissButton,
2526 link,
27+ isFancy,
28+ bannerId,
2629} : BannerProps ) => {
2730 return (
2831 < div
32+ id = { bannerId || '' }
2933 className = { classNames (
3034 'my-4 flex flex-row no-wrap items-center px-4 py-3 gap-3.5 rounded-md border border-transparent text-start text-sm' ,
3135 type === 'error' && 'bg-red-100' ,
32- type === 'info' && 'bg-blue-50' ,
36+ type === 'info' && ! isFancy && 'bg-blue-50' ,
37+ type === 'info' &&
38+ isFancy &&
39+ 'bg-gradient-to-tr from-blue-600/10 to-purple-500/10' ,
3340 type === 'success' && 'bg-green-200' ,
3441 type === 'warning' && 'bg-orange-50' ,
3542 animation ?. animate && animation ?. className
3643 ) }
37- role = "status"
44+ role = { type === 'error' ? 'alert' : 'status' }
45+ aria-live = { type === 'error' ? 'assertive' : 'polite' }
3846 onAnimationEnd = { animation ?. handleAnimationEnd }
47+ tabIndex = { - 1 }
3948 >
4049 { /* Icon fills use 'currentColor' (from text color) for better accessibility in HCM mode */ }
41- { type === 'error' && < ErrorIcon className = "shrink-0" /> }
42- { type === 'info' && < InfoIcon className = "shrink-0" /> }
50+ { type === 'error' && < ErrorIcon className = "shrink-0" ariaHidden /> }
51+ { type === 'info' && ! isFancy && (
52+ < InfoIcon className = "shrink-0" ariaHidden />
53+ ) }
54+ { type === 'info' && isFancy && (
55+ < InformationOutlineBlueIcon className = "shrink-0" ariaHidden />
56+ ) }
4357 { type === 'success' && (
4458 < CheckmarkCircleOutlineCurrentIcon
4559 className = "shrink-0"
4660 mode = "success"
61+ ariaHidden
4762 />
4863 ) }
4964 { type === 'warning' && (
50- < WarningIcon className = "shrink-0" mode = "attention" />
65+ < WarningIcon className = "shrink-0" mode = "attention" ariaHidden />
5166 ) }
5267
5368 < div className = "flex flex-col grow " >
@@ -86,7 +101,12 @@ export const Banner = ({
86101 className = { classNames (
87102 'shrink-0 self-start hover:backdrop-saturate-150 focus:backdrop-saturate-200' ,
88103 type === 'error' && 'hover:bg-red-200 focus:bg-red-300' ,
89- type === 'info' && 'hover:bg-blue-100 focus:bg-blue-200' ,
104+ type === 'info' &&
105+ ! isFancy &&
106+ 'hover:bg-blue-100 focus:bg-blue-200' ,
107+ type === 'info' &&
108+ isFancy &&
109+ 'hover:bg-gradient-to-tr hover:from-blue-700/10 hover:to-purple-600/10 focus:bg-gradient-to-tr focus:from-blue-800/10 focus:to-purple-700/10' ,
90110 type === 'success' && 'hover:bg-green-400 focus:bg-green-500' ,
91111 type === 'warning' && 'hover:bg-orange-100 focus:bg-orange-200'
92112 ) }
0 commit comments