{% load i18n brickwork_icons %} {% comment %} Full-width banner alert (STA-008/009). role="alert" so it is announced. The status icon is decorative (the variant + text carry the meaning; the icon is reinforcement, not the sole signal). This is the loud surface for page-level errors and status, distinct from a field's inline error (forms/_field.html). Dismissible (04-interfaces 4b Dismissible section, 0.9.0, CMP-010): with the tag's dismissible=True the root gains x-data="bwDismissible()" (semver-public, BR-BW-JS-004; no props, state { visible }, method dismiss(), emits bw:dismiss { id }) and an icon-only close button ships WITH the hidden attribute; bwDismissible removes hidden at init, so the no-JS floor shows no dead control. Dismissal removes the element from the DOM only; persistence stays host-owned (CMP-012). Exit at --bw-duration-fast/--bw-ease-in (MOT-007's clear-quickly tier); reduced motion removes instantly (BR-BW-TOK-009). REGRESSION NOTE: with dismissible=False (the default) the rendered output is byte-identical to the 0.8.0 template; the conditional blocks below are laid out so the False path adds not even whitespace. DIRECT INCLUDE (2.0.0): {% bw_alert %} derives `icon` from `variant` before rendering, but a plain {% include %} with only variant/title/message (the copy-paste example shape this package now documents, ADR-056) supplies no `icon` at all, and passing that undefined value to {% bw_icon %} raised IconNotFoundError for the empty name. The variant-to-icon mapping is therefore resolved HERE as a fallback, so both call shapes work. The tag path is unaffected: it still passes an explicit `icon`, which {% firstof %} takes ahead of the fallback, so its output is byte-identical to 1.x. The chain sits at the template's top level on purpose: an `{% ... as %}` assignment made inside an `{% if %}` body would fall out of scope before the icon line. {% endcomment %} {% if variant == "success" %}{% firstof icon "success" as bw_alert_icon %}{% elif variant == "warning" %}{% firstof icon "alert-triangle" as bw_alert_icon %}{% elif variant == "danger" %}{% firstof icon "alert-circle" as bw_alert_icon %}{% else %}{% firstof icon "info" as bw_alert_icon %}{% endif %}