Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.4 KB
Raw Blame
<%#
  Reusable "Why / Intent" box for the style guide.
  Makes the DESIGN INTENT visible: not only how something looks, but why.
  Source of the content: doc/design_system.md (canonical spec with reasoning).

  Locals:
    title:       (optional) heading, default "Warum"
    body:        HTML string with the reasoning (via capture/block or directly)
    principles:  (optional) array of principle short codes, e.g. ["P1", "P2"] → as chips
    tone:        (optional) :default | :danger  (colours the accent)
%>
<% tone ||= :default
   accent = tone == :danger ? "border-red-500 bg-red-50" : "border-black bg-lime-50"
   label_color = tone == :danger ? "text-red-700" : "text-black"
   title ||= "Warum" %>
<div class="mt-4 border-l-4 <%= accent %> rounded-r px-4 py-3">
  <div class="flex items-center gap-2 mb-1">
    <i class="bi bi-lightbulb <%= label_color %>"></i>
    <span class="text-xs font-black uppercase tracking-wide <%= label_color %>"><%= title %></span>
    <% if defined?(principles) && principles.present? %>
      <span class="flex flex-wrap gap-1 ml-1">
        <% principles.each do |p| %>
          <span class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-bold bg-black text-white"><%= p %></span>
        <% end %>
      </span>
    <% end %>
  </div>
  <div class="text-sm text-gray-700 leading-relaxed">
    <%= body.html_safe %>
  </div>
</div>