mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
chore: lift components folder
This commit is contained in:
parent
76df51674d
commit
2200b29b92
301 changed files with 57 additions and 76 deletions
27
src/Notification/NotificationButton.svelte
Normal file
27
src/Notification/NotificationButton.svelte
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script>
|
||||
export let notificationType = "toast"; // "toast" | "inline"
|
||||
export let iconDescription = "close icon";
|
||||
export let renderIcon = Close20;
|
||||
export let title = undefined;
|
||||
export let type = "button";
|
||||
|
||||
import Close20 from "carbon-icons-svelte/lib/Close20";
|
||||
</script>
|
||||
|
||||
<button
|
||||
aria-label={iconDescription}
|
||||
title={iconDescription}
|
||||
{type}
|
||||
class:bx--toast-notification__close-button={notificationType === 'toast'}
|
||||
class:bx--inline-notification__close-button={notificationType === 'inline'}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave>
|
||||
<svelte:component
|
||||
this={renderIcon}
|
||||
{title}
|
||||
class="{notificationType === 'toast' && 'bx--toast-notification__close-icon'}
|
||||
{notificationType === 'inline' && 'bx--inline-notification__close-icon'}" />
|
||||
</button>
|
Loading…
Add table
Add a link
Reference in a new issue