{# General-purpose server-loaded modal — native element. #} {# Contract: ~/.claude/skills/ux-architect/components/modal.md #} {# Parameters: modal_id (str, default: 'dz-modal'), title (str), size (str: sm|md|lg|xl, default: md) #} {# Usage: server returns this template via hx-get; caller triggers .showModal() on the element. #} {# v0.62 CSS refactor: inline Tailwind → semantic .dz-modal-* family (components/fragments.css). Size moves to data-dz-modal-size attribute, close-button chrome shares the .dz-icon-button primitive from app_shell. #} {% set modal_id = modal_id | default('dz-modal') %} {% set size = size | default('md') %}
{% if title %}
{% else %} {# No title — close button still present in top-right #}
{% endif %} {# Body — caller fills this #}
{% block modal_content %} {{ content | safe if content else '' }} {% endblock %}
{# Backdrop click closes the dialog (native dialog semantics) #}