@@ -53,8 +53,7 @@ export class PfAlert extends LitElement {
5353 | 'neutral'
5454 | 'info'
5555 | 'success'
56- | 'danger'
57- | 'cogear' = 'neutral' ;
56+ | 'danger' = 'neutral' ;
5857
5958 @property ( { reflect : true } ) variant ?: 'alternate' | 'inline' ;
6059
@@ -63,15 +62,18 @@ export class PfAlert extends LitElement {
6362 #slots = new SlotController ( this , 'header' , null , 'actions' ) ;
6463
6564 get #icon( ) {
66- const state = this . status . toLowerCase ( ) as this[ 'status' ] ;
67- switch ( state ) {
65+ const internalStatus = this . closest ( '.demo-with-arrows' ) &&
66+ this . status === 'neutral' && this . classList . contains ( 'cogear-demo' )
67+ ? 'cogear'
68+ : this . status ;
69+ switch ( internalStatus ) {
6870 // @ts -expect-error: support for deprecated props
6971 case 'note' : return ICONS . get ( 'info' ) ;
7072 // @ts -expect-error: support for deprecated props
7173 case 'default' : return ICONS . get ( 'neutral' ) ;
7274 // @ts -expect-error: support for deprecated props
7375 case 'error' : return ICONS . get ( 'danger' ) ;
74- default : return ICONS . get ( state ) ;
76+ default : return ICONS . get ( internalStatus ) ;
7577 }
7678 }
7779
@@ -108,10 +110,13 @@ export class PfAlert extends LitElement {
108110 const hasBody =
109111 _isServer || this . #slots. hasSlotted ( SlotController . default as unknown as string ) ;
110112 const { variant = 'inline' } = this ;
111- const state = this . #aliasState( this . status ) ;
113+ // const state = this.#aliasState(this.status);
112114 const inDemo = this . closest ( '.demo-with-arrows' ) !== null ;
113115 const hasDescription = this . querySelector ( 'p' ) !== null ;
114116 const showArrow = inDemo ;
117+ const internalStatus = ( this . closest ( '.demo-with-arrows' ) && this . classList . contains ( 'cogear-demo' ) )
118+ ? 'cogear'
119+ : this . status ;
115120 const arrowDirection = hasDescription ? 'angle-down' : 'angle-right' ;
116121 const footer = html `< footer class ="${ classMap ( { hasActions } ) } "
117122 <!-- Provide actions that the user can take for the alert -->
@@ -124,8 +129,8 @@ export class PfAlert extends LitElement {
124129 ${ classMap ( {
125130 hasBody,
126131 light : true ,
127- [ this . status as string ] : true ,
128- [ variant ] : ! ! variant ,
132+ [ internalStatus ] : true ,
133+ [ variant ?? 'inline' ] : ! ! variant ,
129134 } ) }
130135 role ="alert"
131136 aria-hidden="false"
0 commit comments