alembic / static /icons.py
GitHub Actions
Deploy alembic from b8a1bc0
b68aeed
Raw
History Blame Contribute Delete
7.56 kB
"""Inline SVG icons for Alembic UI.
All icons are hand-crafted SVG paths — no emojis, no external dependencies.
Use as: ICONS["name"] returns an SVG string ready for HTML injection.
Designed at 24x24 viewBox, stroke-based, 1.5px stroke weight.
"""
ICONS = {
# Brand
"alembic": '''<svg width="28" height="28" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 3h6v2.5l4.5 8.5a3 3 0 01-2.68 4.5H7.18a3 3 0 01-2.68-4.5L9 5.5V3z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 3h6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M6 15h12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" opacity="0.5"/>
<circle cx="10" cy="17" r="1" fill="currentColor" opacity="0.6"/>
<circle cx="14" cy="16.5" r="0.75" fill="currentColor" opacity="0.4"/>
</svg>''',
# Services
"sheets": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="3" width="18" height="18" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M3 9h18M3 15h18M9 3v18M15 3v18" stroke="currentColor" stroke-width="1.5" opacity="0.5"/>
</svg>''',
"notion": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 4.5A1.5 1.5 0 015.5 3h9l5.5 5.5V19.5a1.5 1.5 0 01-1.5 1.5h-13A1.5 1.5 0 014 19.5v-15z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
<path d="M8 12h8M8 15.5h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" opacity="0.6"/>
</svg>''',
"slack": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 15a2 2 0 11-2-2h2v2zM7 15a2 2 0 012-2v-2a2 2 0 110 4h2a2 2 0 110 4h-2a2 2 0 01-2-2v-2z" stroke="currentColor" stroke-width="1.5"/>
<path d="M18 9a2 2 0 112 2h-2V9zM17 9a2 2 0 01-2 2v2a2 2 0 110-4h-2a2 2 0 110-4h2a2 2 0 012 2v2z" stroke="currentColor" stroke-width="1.5"/>
</svg>''',
"gmail": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M3 7l9 6 9-6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>''',
"github": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.49.5.09.682-.218.682-.482 0-.237-.009-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.607.069-.607 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.577.688.48C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z" fill="currentColor"/>
</svg>''',
# Gallery app types
"mail": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M3 7l9 6 9-6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>''',
"git-pr": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="6" cy="6" r="2.5" stroke="currentColor" stroke-width="1.5"/>
<circle cx="18" cy="18" r="2.5" stroke="currentColor" stroke-width="1.5"/>
<circle cx="18" cy="6" r="2.5" stroke="currentColor" stroke-width="1.5"/>
<path d="M6 8.5v7M15.5 6H10a2 2 0 00-2 2v2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>''',
"invoice": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 2h9l5 5v15H6a2 2 0 01-2-2V4a2 2 0 012-2z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
<path d="M14 2v5h5" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
<path d="M9 13h6M9 16h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" opacity="0.6"/>
</svg>''',
"bot": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="8" width="16" height="12" rx="3" stroke="currentColor" stroke-width="1.5"/>
<circle cx="9" cy="14" r="1.5" fill="currentColor"/>
<circle cx="15" cy="14" r="1.5" fill="currentColor"/>
<path d="M12 4v4M10 4h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>''',
"chart": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 20h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M4 16l4-4 4 2 4-6 4 3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="8" cy="12" r="1.5" fill="currentColor" opacity="0.4"/>
<circle cx="12" cy="14" r="1.5" fill="currentColor" opacity="0.4"/>
<circle cx="16" cy="8" r="1.5" fill="currentColor" opacity="0.4"/>
</svg>''',
# UI elements
"plus": '''<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>''',
"link": '''<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>''',
"viewport": '''<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="4" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M8 20h8M12 18v2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="12" cy="11" r="3" stroke="currentColor" stroke-width="1.5" opacity="0.5"/>
</svg>''',
"spinner": '''<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>''',
"dot": '''<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="4" cy="4" r="3" fill="currentColor"/>
</svg>''',
}
def icon(name: str, cls: str = "") -> str:
"""Return SVG icon HTML with optional CSS class wrapper."""
svg = ICONS.get(name, "")
if not svg:
return ""
if cls:
return f'<span class="{cls}">{svg}</span>'
return svg