Files
WRNexusJS/packages/ui/components/alert.wrn
T

24 lines
729 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
component Alert {
props {
class = ""
title = "Notice"
description = ""
variant = "info"
dismissible = false
}
state visible = true
view {
<aside data-show="visible" role="alert" class="wire-alert wire-alert--{variant} wire-alert--rich {class}">
<span class="wire-alert__icon" aria-hidden="true"></span>
<div class="wire-alert__content">
{#if title}<h3 class="wire-alert__title">{title}</h3>{/if}
{#if description}<p class="wire-alert__body">{description}</p>{/if}
<slot />
</div>
{#if dismissible}<button type="button" aria-label="Dismiss" @click="visible = false" class="wire-alert__dismiss">×</button>{/if}
</aside>
}
}