-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
6a66cd1
commit 545fa08
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
{# @var string title #} | ||
{% set title = title ?? null %} | ||
|
||
{# @var string description #} | ||
{% set description = description ?? null %} | ||
|
||
{# @var bool dismissible #} | ||
{% set dismissible = dismissible ?? false %} | ||
|
||
<div | ||
role="alert" | ||
data-component="AlertBanner" | ||
aria-live="assertive" | ||
aria-atomic="true" | ||
class="relative flex flex-col gap-16 bg-sky-100 p-24 dark:bg-gray-600 dark:text-white lg:p-48" | ||
x-data="{ dismiss() { this.$root.remove() } }" | ||
> | ||
{% if title %} | ||
<h2 class="text-md font-bold">{{ title }}</h2> | ||
{% endif %} | ||
|
||
{% if description %} | ||
<p>{{ description }}</p> | ||
{% endif %} | ||
|
||
{{ dismissible ? include('_components/button.twig', { | ||
variant: 'subtle', | ||
size: 'sm', | ||
icon: 'close', | ||
iconOnly: true, | ||
class: 'absolute right-24 top-24', | ||
text: 'Close', | ||
attrs: { | ||
'x-on:click': 'dismiss()', | ||
}, | ||
}) }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends 'viget-parts-kit/layout.twig' %} | ||
|
||
{% block main %} | ||
{{ include('_components/alert-banner.twig', { | ||
title: 'Dismissible Alert Banner', | ||
description: 'Cillum dolor nisi et sunt in in et ullamco eiusmod duis aute et fugiat excepteur. Sit irure consectetur anim do aliqua excepteur amet nulla magna enim proident incididunt ipsum.', | ||
dismissible: true, | ||
}) }} | ||
|
||
<hr class="my-48" /> | ||
|
||
{{ include('_components/alert-banner.twig', { | ||
title: 'Non-Dismissible Alert Banner', | ||
description: 'Cillum dolor nisi et sunt in in et ullamco eiusmod duis aute et fugiat excepteur. Sit irure consectetur anim do aliqua excepteur amet nulla magna enim proident incididunt ipsum.', | ||
dismissible: false, | ||
}) }} | ||
{% endblock %} |