{# Hand-drawn SVG primitives. Paths are copied verbatim from design_handoff_agent_drop/prototype/tokens.jsx. The handoff says: "They're deliberately imperfect and shouldn't be re-drawn by hand." So don't tidy them up. Don't simplify. Don't regenerate. Whimsy is pinned at 10 for Agent Drop, so these render unconditionally — no threshold gating here. Call sites should wrap in a container with `position: relative` for the absolutely-positioned primitives (hand_circle, pen_underline). #} {# Imperfect hand-drawn circle — drawn behind the "N new" counter and similar emphasis marks. Absolutely positioned so it sits behind the foreground text; callers provide the `position: relative` context. #} {% macro hand_circle(color="var(--color-peach-deep)", size=36, stroke_width=2) -%} {%- endmacro %} {# Wobbly pen underline — sits beneath source tags / meta labels. Width is driven by `length_chars * 7.3`, matching the prototype's ~7.3px per-char heuristic. Absolutely positioned at bottom: -4px of its container. #} {% macro pen_underline(length_chars=10, color="var(--color-peach)") -%} {%- set w = (length_chars * 7.3) | round(2) -%} {%- endmacro %} {# Brush mark — decorative hand-drawn stroke for urgent / high priority. Two overlapping paths: main stroke (3.2 width, 0.85 opacity) + undertone (1.4 width, 0.35 opacity). Two size variants per the handoff: 48x14 for urgent, 28x10 for high. #} {% macro brush_mark(variant="urgent", color="var(--color-peach-deep)") -%} {%- if variant == "high" -%} {%- set w = 28 -%} {%- set h = 10 -%} {%- else -%} {%- set w = 48 -%} {%- set h = 14 -%} {%- endif -%} {%- endmacro %} {# Accessible confirm dialog. Replaces `onsubmit="return confirm('…')"` with a native role="alertdialog". The matching
on the page gets its submit intercepted: the dialog opens with showModal(), and only resolves to the form actually submitting when the user clicks the confirm button. Cancel / Escape / clicking the backdrop close without submission. Native handles the focus trap and focus-return-to-trigger behaviour. Args: form_id — DOM id of the being guarded. title — short heading shown at the top of the dialog. message — body text under the heading. confirm_text — label on the destructive-confirm button. danger — when true, confirm button uses .btn--danger. #} {% macro confirm_dialog(form_id, title, message, confirm_text, danger=true) -%} {%- set dialog_id = form_id ~ "-confirm-dialog" -%} {%- set title_id = dialog_id ~ "-title" -%} {%- set msg_id = dialog_id ~ "-message" -%}

{{ title }}

{{ message }}

{%- endmacro %} {# Loose arrow — empty-state curved arrow, rotated 8 degrees. Paths copied verbatim from tokens.jsx LooseArrow. #} {% macro loose_arrow(color="var(--color-ink-mute)", width=90, height=60) -%} {%- endmacro %}