{% load i18n brickwork_icons %} {% comment %} Toast (04-interfaces section 4b, 0.9.0). PRIVATE render target of the {% bw_toast %} tag (templatetags/brickwork_interactions.py): never {% include %} this file directly; the tag carries the render-time enforcement (intent validated against success|warning|danger|info with "neutral" raising, CMP-022; duration validated, CBH-009; action_label/action_url paired, CMP-023; instance id derived) and maps the intent to its registry icon. Server-rendered ONLY (BR-BW-HTMX-007): there is no client-side toast-creation API. An htmx response appends a toast out of band by rendering the tag inside a wrapper carrying hx-swap-oob="afterbegin:#bw-toast-region" (the reserved non-field-scoped OOB use, BR-BW-HTMX-003; zero event listeners needed, BR-BW-HTMX-004), targeting _toast_region.html's stable id (BR-BW-HTMX-005). The no-JS floor is the same feedback delivered as django.contrib.messages banners rendered via _alert.html on the redirected page (STA-008): the toast is the enhanced form of a flash message, never the only form. The close control is ALWAYS rendered (CBH-012, WCAG 2.2.1): an icon-only button with a translated accessible name, an ordinary tab stop (no shortcuts, no roving behaviour; Escape stays the modal's key). A toast never steals focus on arrival (BR-BW-JS-006). danger toasts additionally carry role="alert" so they announce assertively over the region's polite live region. bwToast (semver-public, BR-BW-JS-004; props { duration }, state { visible, paused }, method dismiss()) owns the auto-dismiss timer, resolving --bw-duration-toast-{short,normal,long} ("persistent" never auto-dismisses) and pausing while the toast is hovered or contains focus (WCAG 2.2.1). It toggles data-bw-visible on the root as the visibility marker the CSS keys enter/exit on, and emits bw:toast:show { id, intent } / bw:toast:dismiss { id, reason: "timeout"|"dismiss" } (notifications only, never a creation path, BR-BW-HTMX-004). The data-bw-toast-* attributes are bwToast's internal hooks, not consumer contract surface. The x-data argument object is the wiring point for the tag's duration argument. Tokens, elevation, motion (CSS lane): --bw-z-toast, --bw-elevation-5 (the reserved toast row), radius --bw-radius-xl, background --bw-color-surface-raised, intent edge and icon from the --bw-color-X-* intent tiers. Enter at --bw-duration-normal/--bw-ease-out translating in from the region's edge; exit at --bw-duration-fast/--bw-ease-in (MOT-007). Reduced motion: instant swap, timers unchanged (BR-BW-TOK-009). {% endcomment %}
{% bw_icon icon size="md" decorative=True css_class="bw-toast__icon" %}

{{ message }}

{% if action_label %}{{ action_label }}{% endif %} {% translate "Dismiss" as bw_toast_close_label %}