{#- chirp-ui: Tooltip macro
Wraps child, shows tooltip bubble on hover with arrow positioning. Pure CSS.
Usage:
from "chirpui/tooltip.html" import tooltip
{% call tooltip("Copy to clipboard") %}
{% end %}
{% call tooltip("Below the element", position="bottom") %}
Hover me
{% end %}
Positions: top (default), bottom, left, right
-#}
{% def tooltip(content=none, hint=none, position="top", cls="") %}
{% set tooltip_text = hint if hint is not none else content %}
{% set pos = position if position in ("top", "bottom", "left", "right") else "top" %}
{% slot %}
{{ tooltip_text }}
{% end %}