Skip to content

Commit 154a42e

Browse files
authored
fix(callout-notification): render icons via iconLoader (#21202)
1 parent 9034d3d commit 154a42e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/web-components/src/components/notification/callout-notification.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import { html, svg } from 'lit';
8+
import { html } from 'lit';
99
import { property } from 'lit/decorators.js';
1010
import { prefix } from '../../globals/settings';
1111
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
12-
import CDSActionableNotification from './actionable-notification';
13-
import { iconsForKinds } from './actionable-notification';
12+
import { iconLoader } from '../../globals/internal/icon-loader';
13+
import CDSActionableNotification, {
14+
iconsForKinds,
15+
} from './actionable-notification';
1416
import { NOTIFICATION_KIND } from './defs';
1517
import styles from './actionable-notification.scss?lit';
1618

@@ -38,15 +40,13 @@ class CDSCalloutNotification extends CDSActionableNotification {
3840

3941
protected _renderIcon() {
4042
const { statusIconDescription, kind } = this;
41-
const { [kind]: icon } = iconsForKinds;
42-
return !icon
43-
? undefined
44-
: icon({
43+
const IconComponent = iconsForKinds[kind];
44+
return IconComponent
45+
? iconLoader(IconComponent, {
4546
class: `${prefix}--inline-notification__icon`,
46-
children: !statusIconDescription
47-
? undefined
48-
: svg`<title>${statusIconDescription}</title>`,
49-
});
47+
'aria-label': statusIconDescription || undefined,
48+
})
49+
: undefined;
5050
}
5151

5252
protected _renderText() {

0 commit comments

Comments
 (0)