{#- chirp-ui: Alert component Status alerts with variant styling and optional dismiss. When collapsible=true, renders as
/ (collapsed by default if open=false). Named slots: header_actions (canonical), actions (alias, backward compat). Usage: from "chirpui/alert.html" import alert call alert(variant="success") Done! Your changes have been saved. end call alert(variant="error", dismissible=true) Something went wrong. {% slot header_actions %}{% end %} end call alert(variant="warning", collapsible=true, open=false, icon="↑", title="Shortcut collisions") Long warning content revealed on expand. end Variants: info (default), success, warning, error -#} {% def alert(variant="info", appearance="", tone="", dismissible=false, icon=none, title=none, cls="", collapsible=false, open=true) %} {# @consumes _card_variant from: card — falls back to "" if not in card context #} {% set _variant = variant if variant != "info" else (consume("_card_variant", "") or variant) %} {% set _appearance = appearance | validate_appearance_block("alert", "") %} {% set _tone = tone | validate_tone_block("alert", "") %} {% set alert_class = "alert" | bem(variant=_variant, appearance=_appearance, tone=_tone, cls=cls) %} {% if collapsible %} {% else %} {% endif %} {% end %}