toasts.html 12 lignes · 705 octets
{# C-002 Toasts (design.md : toast). Alimentés par l'événement `notify` (en-tête HX-Trigger). #}
<div id="toast-container" x-data="toasts" x-on:notify.window="add"
     class="fixed bottom-md right-md z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-xs"
     role="status" aria-live="polite">
  <template x-for="toast in items" :key="toast.id">
    <div :class="toast.classes">
      <p class="flex-1" x-text="toast.message"></p>
      <button type="button" x-on:click="remove" :data-id="toast.id" aria-label="Fermer la notification"
              class="-m-xxs grid size-8 shrink-0 place-items-center rounded-full text-ink-secondary hover:bg-muted">✕</button>
    </div>
  </template>
</div>