{#- chirp-ui: Layout primitives — container, grid (flow), frame (structural), stack, cluster, block. grid() = repeat(auto-fit, …) for wrapping siblings. frame() = explicit columns (hero, sidebar, …). See docs/LAYOUT-GRIDS-AND-FRAMES.md. -#} {% from "chirpui/surface.html" import surface %} {% from "chirpui/breadcrumbs.html" import breadcrumbs %} {% def container(max_width="72rem", padding=true, cls="") %}
{% slot %}
{% end %} {#- grid(): flow — auto-fit columns; cols=2|3|4 scales --chirpui-grid-min. Fixed tracks: preset + aliases — docs/LAYOUT-PRESETS.md. detail_single only for detail-two | split-1-1.35. items=start|end|center. -#} {% def grid(cols=none, gap=none, preset=none, items=none, detail_single=false, cls="") %} {% set pn = preset %} {% set _bento = pn == "bento-211" or pn == "split-2-1-1" %} {% set _thirds = pn == "thirds" or pn == "split-thirds" or pn == "three-equal" %} {% set _detail = pn == "detail-two" or pn == "split-1-1.35" %} {% set _detail_one_col = pn == "detail-two-single" or pn == "split-1-1.35-single" %} {% set _has_preset = _bento or _thirds or _detail or _detail_one_col %} {% set _detail_single_on = detail_single or _detail_one_col %}
{% slot %}
{% end %} {#- frame(): structural regions with explicit tracks — two direct children by default. variant= balanced | hero | sidebar-end. Override columns via style="--chirpui-frame-hero-columns: …" on this element or a parent. -#} {% def frame(variant="balanced", gap=none, cls="") %}
{% slot %}
{% end %} {% def stack(gap=none, cls="") %}
{% slot %}
{% end %} {% def cluster(gap=none, cls="") %}
{% slot %}
{% end %} {% def block(span=1, cls="") %}
{% slot %}
{% end %} {#- page_header: title, subtitle, meta, breadcrumb_items, variant, actions slot -#} {% def page_header(title, subtitle=none, meta=none, breadcrumb_items=none, variant="default", cls="") %} {% set variant = variant | validate_variant_block("page_header", default="default") %} {% set variant_class = " chirpui-page-header--" ~ variant if variant != "default" else "" %}
{% if breadcrumb_items %} {{ breadcrumbs(breadcrumb_items, cls="chirpui-page-header__breadcrumbs") }} {% end %}

{{ title }}

{% if subtitle %}

{{ subtitle }}

{% end %} {% if meta %}

{{ meta | safe }}

{% end %}
{% slot actions %}
{% end %} {#- section_header: title, subtitle, icon, variant, actions slot -#} {% def section_header(title, subtitle=none, icon=none, variant="default", cls="") %} {% set variant = variant | validate_variant_block("section_header", default="default") %} {% set variant_class = " chirpui-section-header--inline" if variant == "inline" else "" %}
{% if icon %}{{ icon | icon }}{% end %}
{{ title }} {% if subtitle and variant != "inline" %}

{{ subtitle }}

{% end %}
{% slot actions %}
{% end %} {#- section_header_inline: deprecated alias — use section_header(variant="inline") with {% slot actions %} -#} {% def section_header_inline(title, icon=none, cls="") %} {% call section_header(title, icon=icon, variant="inline", cls=cls) %} {% slot actions %}{% slot %}{% end %} {% end %} {% end %} {#- section: composite surface + section_header + content. Reduces boilerplate. Use {% slot actions %} for section-level buttons (Refresh, Auto-detect, etc.). full_width=true wraps in chirpui-blade for edge-to-edge blade-style sections. parallax=true adds subtle scroll-driven background motion (Chrome 115+). -#} {% def section(title, subtitle=none, icon=none, surface_variant="muted", full_width=false, parallax=false, cls="") %} {% set surface_variant = surface_variant | validate_variant_block("surface", default="muted") %} {% if full_width %}
{% end %} {% call surface(variant=surface_variant, full_width=full_width) %} {% call section_header(title, subtitle, icon) %} {% slot actions %}{% slot actions %}{% end %} {% end %} {% slot %}{% slot %}{% end %} {% end %} {% if full_width %}
{% end %} {% end %} {#- section_collapsible: details/summary with section_header as summary. For "Advanced" config. -#} {% def section_collapsible(title, open=false, surface_variant="muted", cls="") %} {% set surface_variant = surface_variant | validate_variant_block("surface", default="muted") %}
{% call section_header_inline(title) %}{% end %} {% call surface(variant=surface_variant) %} {% slot %} {% end %} {% end %}
{% end %}