blob: 7c35f5e0b31e64c5fa0160a407c81345f44e00ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
{% macro connector_icon(size=16) %}
<svg width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<circle cx="4" cy="12" r="3" fill="currentColor" />
<line x1="7" y1="12" x2="17" y2="12" stroke="currentColor" stroke-width="2" stroke-dasharray="1 4" stroke-linecap="round" />
<circle cx="20" cy="12" r="3" fill="currentColor" />
</svg>
{% endmacro %}
{% macro sun_icon(size=16) %}
<svg class="icon-sun" width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2" />
<path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
{% endmacro %}
{% macro moon_icon(size=16) %}
<svg class="icon-moon" width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path d="M20 14.5A8.5 8.5 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
</svg>
{% endmacro %}
{% macro field(name, type='text', label='', value='', error='', placeholder='') %}
<div class="field">
<label class="field__label" for="field-{{ name }}">{{ label }}</label>
<input
class="field__input{% if error %} field__input--error{% endif %}"
type="{{ type }}"
id="field-{{ name }}"
name="{{ name }}"
value="{{ value or '' }}"
placeholder="{{ placeholder }}"
{% if error %}aria-invalid="true" aria-describedby="field-{{ name }}-error"{% endif %}
/>
{% if error %}
<p class="field__error" id="field-{{ name }}-error">{{ error }}</p>
{% endif %}
</div>
{% endmacro %}
{% macro button(text, variant='primary', type='submit') %}
<button class="btn btn--{{ variant }} btn--full" type="{{ type }}">{{ text }}</button>
{% endmacro %}
{% macro status_badge(label, variant='good') %}
<span class="nav__status">
<span class="status-dot status-dot--{{ variant }}" aria-hidden="true"></span>
<span class="mono small muted">{{ label }}</span>
</span>
{% endmacro %}
|