{% macro Icon(name, classes="") -%} {% autoescape false %} {% endautoescape %} {%- endmacro %} {% macro SidenavItem(label, href, active=False, icon=None, subnav=None) -%}
  • {% if icon %} {{ Icon(icon, classes="sidenav__link-icon") }} {% endif %} {{label}} {% if subnav and active %} {% endif %}
  • {%- endmacro %} {% macro Modal() -%} {%- endmacro %} {% macro EmptyState(message, actionLabel, actionHref, icon=None) -%}

    {{ message }}

    {% if icon %} {{ Icon(icon) }} {% endif %} {{ actionLabel }}
    {%- endmacro %} {% macro Alert(title, message=None, actions=None, level='info') -%} {% set role = 'alertdialog' if actions else 'alert' %} {% set levels = { 'warning': { 'icon': 'alert', 'tone': 'assertive' }, 'error': { 'icon': 'alert', 'tone': 'assertive' }, 'info': { 'icon': 'info', 'tone': 'polite' }, 'success': { 'icon': 'ok', 'tone': 'polite' } } %}
    {{ Icon(levels.get(level).get('icon'), classes='alert__icon icon--large') }}

    {{title}}

    {% if message %}
    {{ message | safe }}
    {% endif %} {% if actions %}
    {{ actions | safe }}
    {% endif %}
    {%- endmacro %} {% macro TextInput(field, placeholder='') -%}
    {{ field(placeholder=placeholder) | safe }} {% if field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %}
    {%- endmacro %} {% macro OptionsInput(field, inline=False) -%}
    {{ field.label }} {% if field.description %} {{ field.description | safe }} {% endif %} {% if field.errors %} {{ Icon('alert') }} {% endif %} {{ field() }} {% if field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %}
    {%- endmacro %}