{#- chirp-ui: Metric grid/card
Overview/KPI wrappers for dashboard-style pages.
metric_card forwards attrs / attrs_map to the outer card or (e.g. id for HTMX targets).
-#}
{% from "chirpui/layout.html" import grid %}
{% from "chirpui/card.html" import card %}
{% from "chirpui/stat.html" import stat %}
{% def metric_grid(cols=3, gap="md", cls="") %}
{% call grid(cols=cols, gap=gap, cls="chirpui-metric-grid" ~ (" " ~ cls if cls else "")) %}
{{ caller() }}
{% end %}
{% end %}
{% def metric_card(value, label, icon=none, trend=none, trend_direction="", hint=none, href=none, icon_bg="", footer_label=none, footer_href=none, cls="", attrs="", attrs_map=none) %}
{% if href %}
{{ hint }}
{{ hint }}
{% endif %} {% if footer_label %} {{ footer_label }} → {% end %} {% end %} {% endif %} {% end %}