{% set p = component.props %} {% set element_id = 'forge-element-' ~ component.element_id %} {% macro layout_classes() -%} {% if p.get('padding') is not none %} forge-padding--{{ p.padding }}{% endif %}{% if p.get('density', 'inherit') != 'inherit' %} forge-density--{{ p.density }}{% endif %}{% if p.get('gap_x') is not none %} forge-gap-x--{{ p.gap_x }}{% endif %}{% if p.get('gap_y') is not none %} forge-gap-y--{{ p.gap_y }}{% endif %} {%- endmacro %} {% macro control_disabled(condition=false) -%} {% if not interactive or condition %} disabled{% endif %} {%- endmacro %} {% macro drilldown(aria_label='View related details') -%} {% if component.action %}View details{{ component.action_icon }}{% endif %} {%- endmacro %} {% if component.type == 'page' %}
{{ children }}
{% elif component.type == 'container' %}
{{ children }}
{% elif component.type in ['stack', 'inline'] %}
{{ children }}
{% elif component.type == 'grid' %}
{{ children }}
{% elif component.type == 'grid-item' %}
{{ children }}
{% elif component.type == 'card' %}
{% if p.title %}

{{ p.title }}

{% endif %}{{ children }}{{ drilldown('View details for ' ~ p.title if p.title else 'View card details') }}
{% elif component.type in ['card-header', 'card-body', 'card-footer'] %} {% set tag = 'header' if component.type == 'card-header' else ('footer' if component.type == 'card-footer' else 'div') %} <{{ tag }} id="{{ element_id }}" class="forge-{{ component.type }}{{ layout_classes() }}">{{ children }} {% elif component.type == 'content-group' %}
{{ children }}
{% if p.description %}

{{ p.description }}

{% endif %}{% if p.caption %}

{{ p.caption }}

{% endif %}
{% elif component.type == 'disclosure' %}
{{ p.title }}{% if p.summary %}{{ p.summary }}{% endif %}
{{ children }}
{% elif component.type == 'section' %}
{% if p.title %}

{{ p.title }}

{% if p.description %}

{{ p.description }}

{% endif %}
{% endif %}{{ children }}
{% elif component.type == 'page-header' %}

{{ p.title }}

{% if p.subtitle %}

{{ p.subtitle }}

{% endif %}
{% elif component.type == 'divider' %}
{% elif component.type == 'repeat' %}
{{ children }}
{% elif component.type == 'heading' %} {{ p.text }} {% elif component.type == 'text' %}

{{ p.text }}

{% elif component.type == 'badge' %} {{ p.label }} {% elif component.type == 'icon' %} {% elif component.type == 'key-value' %}
{% for row in extra.rows %}
{{ row.label }}
{{ row.value }}
{% endfor %}
{% elif component.type == 'aggregate-metric' %}

{{ p.label }}

{{ extra.value }}Filtered sample · up to 100 rows{{ drilldown('View details for ' ~ p.label) }}
{% elif component.type == 'mermaid' %}
{{ p.title }}
{% if extra.nodes %}
{{ extra.svg }}
    {% for node in extra.nodes %}
  1. {{ node.label }}
  2. {% endfor %}
{% if p.state_path %}{% endif %}
{% for edge in extra.edges %}{% else %}{% endfor %}
Connections
FromToRelationship
{% for node in extra.nodes if node.id == edge.source %}{{ node.label }}{% endfor %}{% for node in extra.nodes if node.id == edge.target %}{{ node.label }}{% endfor %}{{ edge.label or '→' }}
No connections
{% else %}

No nodes match the current filter.

{% endif %}
{% elif component.type == 'metric' %}

{{ p.label }}

{{ extra.value }}{% if extra.delta is not none %}{{ extra.delta }} vs comparison{% endif %}{% if p.detail %}{{ p.detail }}{% endif %}{{ drilldown('View details for ' ~ p.label) }}
{% elif component.type == 'alert' %}
{{ p.title }}

{{ p.message }}

{{ drilldown('View details for ' ~ p.title) }}
{% elif component.type == 'progress' %}
{{ p.label }}{{ extra.display_value }}
{{ p.value }} / {{ p.maximum }}{{ drilldown('View details for ' ~ p.label) }}
{% elif component.type == 'empty-state' %}

{{ p.title }}

{{ p.message }}

{{ drilldown('View details for ' ~ p.title) }}
{% elif component.type == 'table' %}
{% for column in p.columns %}{% endfor %}{% for row in extra.rows %}{% for column in p.columns %}{{ row.get(column.key, '—') }}{% endfor %}{% else %}{% endfor %}
{{ column.label }}
{{ p.empty_message }}
{{ drilldown('View table details') }}
{% elif component.type == 'status-list' %}
    {% for row in extra.rows %}
  1. {{ row.get('name', row.get('device_id', 'Item')) }}{{ row.get('message', row.get('status', '')) }}
  2. {% else %}
  3. {{ p.empty_message }}
  4. {% endfor %}
{{ drilldown('View status details') }}
{% elif component.type == 'timeline' %}
    {% for row in extra.rows %}
  1. {{ row.get('message', row.get('name', 'Activity')) }}

  2. {% else %}
  3. {{ p.empty_message }}
  4. {% endfor %}
{{ drilldown('View timeline details') }}
{% elif component.type in ['line-chart', 'bar-chart', 'donut-chart', 'sparkline'] %}
{% if p.get('title') %}
{{ p.get('title') }}
{% elif p.get('label') %}
{{ p.get('label') }}
{% endif %}{{ extra.chart_svg }}
Data summary{% if component.type == 'donut-chart' %}{% else %}{% endif %}{% for row in extra.chart_rows %}{% if component.type == 'donut-chart' %}{% else %}{% endif %}{% endfor %}
CategoryValueSeriesLatestRange
{{ row.label }}{{ row.value }}{{ row.latest }}{{ row.minimum }}–{{ row.maximum }}
{{ drilldown('View details for ' ~ (p.get('title') or p.get('label') or 'chart')) }}
{% elif component.type == 'button' %} {{ p.label }} {% elif component.type == 'modal' %}

{{ p.title }}

{% if p.description %}

{{ p.description }}

{% endif %}{{ extra.close_icon }}
{{ children }}
{% elif component.type == 'form' %}
{% if p.title %}

{{ p.title }}

{% endif %}{{ children }}{{ p.submit_label }} {% elif component.type == 'field-group' %}
{{ p.legend }}{% if p.description %}

{{ p.description }}

{% endif %}{{ children }}
{% elif component.type == 'field' %}
{{ p.label }}{% if p.hint %}

{{ p.hint }}

{% endif %}{{ children }}
{% elif component.type in ['text-input', 'search'] %} {% elif component.type == 'textarea' %} {% elif component.type == 'number-input' %} {% elif component.type == 'select' %} {% elif component.type == 'radio-group' %}
{{ p.label }}{% for option in p.options %}{% endfor %}
{% elif component.type in ['checkbox', 'toggle'] %} {% elif component.type == 'tabs' %}
{{ children }}
{% elif component.type == 'date-range' %} {% elif component.type == 'breadcrumbs' %} {% elif component.type == 'pagination' %} {% elif component.type == 'toast' %}
{{ p.message }}
{% elif component.type == 'image' %} {% elif component.type == 'file-upload' %} {% else %} {% endif %}