feat(notification)!: change InlineNotification props

Add new props: statusIconDescription and closeButtonDescription

BREAKING CHANGE: remove iconDescription prop
This commit is contained in:
Enrico Sacchetti 2022-12-16 13:48:33 -05:00
commit ee21257300
8 changed files with 74 additions and 32 deletions

View file

@ -27,8 +27,14 @@
/** Set to `true` to hide the close button */
export let hideCloseButton = false;
/** Specify the ARIA label for the icon */
export let iconDescription = "Closes notification";
/**
* Specify the ARIA label for the status icon
* @type {string}
* */
export let statusIconDescription = kind + " icon";
/** Specify the ARIA label for the close button */
export let closeButtonDescription = "Close notification";
import { createEventDispatcher, onMount } from "svelte";
import NotificationIcon from "./NotificationIcon.svelte";
@ -82,7 +88,11 @@
on:mouseleave
>
<div class:bx--inline-notification__details="{true}">
<NotificationIcon notificationType="inline" kind="{kind}" />
<NotificationIcon
notificationType="inline"
kind="{kind}"
iconDescription="{statusIconDescription}"
/>
<div class:bx--inline-notification__text-wrapper="{true}">
<p class:bx--inline-notification__title="{true}">
<slot name="title">{title}</slot>
@ -96,7 +106,7 @@
<slot name="actions" />
{#if !hideCloseButton}
<NotificationButton
iconDescription="{iconDescription}"
iconDescription="{closeButtonDescription}"
notificationType="inline"
on:click="{close}"
/>

View file

@ -12,7 +12,7 @@
export let notificationType = "toast";
/** Specify the ARIA label for the icon */
export let iconDescription = "Closes notification";
export let iconDescription;
import CheckmarkFilled from "../icons/CheckmarkFilled.svelte";
import ErrorFilled from "../icons/ErrorFilled.svelte";