vanilla-framework 4.37.2 → 4.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scss/_patterns_data-spotlight.scss +2 -3
- package/scss/_patterns_equal-height-row.scss +18 -11
- package/templates/_macros/shared/vf_article_block.jinja +1 -0
- package/templates/_macros/shared/vf_blog-block.jinja +60 -0
- package/templates/_macros/shared/vf_cta-block.jinja +93 -0
- package/templates/_macros/shared/vf_description-block.jinja +33 -0
- package/templates/_macros/shared/vf_divided-section-block.jinja +67 -0
- package/templates/_macros/shared/vf_equal-heights-block.jinja +68 -0
- package/templates/_macros/shared/vf_linked-logo-block.jinja +34 -0
- package/templates/_macros/shared/vf_logo-block.jinja +29 -0
- package/templates/_macros/shared/vf_section_top_rule.jinja +27 -4
- package/templates/_macros/shared/vf_tabs.jinja +78 -0
- package/templates/_macros/vf_basic-section.jinja +58 -139
- package/templates/_macros/vf_blog.jinja +4 -48
- package/templates/_macros/vf_cta-section.jinja +9 -2
- package/templates/_macros/vf_divided-section.jinja +4 -56
- package/templates/_macros/vf_equal-heights.jinja +28 -48
- package/templates/_macros/vf_linked-logo-section.jinja +5 -32
- package/templates/_macros/vf_pricing-block.jinja +9 -1
- package/templates/_macros/vf_quote-wrapper.jinja +278 -139
- package/templates/_macros/vf_tab-section.jinja +238 -0
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
{% from "_macros/shared/vf_dedent.jinja" import vf_dedent %}
|
|
2
2
|
{% from "_macros/shared/vf_section_top_rule.jinja" import vf_section_top_rule %}
|
|
3
|
+
{% from "_macros/shared/vf_cta-block.jinja" import vf_cta_block %}
|
|
4
|
+
{% from "_macros/shared/vf_description-block.jinja" import vf_description_block %}
|
|
3
5
|
{% from "_macros/vf_linked-logo-section.jinja" import vf_linked_logo_section %}
|
|
6
|
+
{% from "_macros/shared/vf_linked-logo-block.jinja" import vf_linked_logo_block %}
|
|
7
|
+
{% from "_macros/shared/vf_logo-block.jinja" import vf_logo_block %}
|
|
8
|
+
|
|
9
|
+
{% macro vf_basic_section_blocks(items=[]) %}
|
|
10
|
+
{%- for item in items -%}
|
|
11
|
+
{%- set item_padding = (item.get("padding", "")) | trim -%}
|
|
12
|
+
{%- if item_padding not in ["shallow"] -%}
|
|
13
|
+
{%- set item_padding="" -%}
|
|
14
|
+
{%- endif -%}
|
|
4
15
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
{%- set type = (description_config.get("type", "text")) | trim -%}
|
|
10
|
-
{%- if type not in ["text", "html"] -%}
|
|
11
|
-
{%- set type = "text" -%}
|
|
12
|
-
{%- endif -%}
|
|
16
|
+
{%- set item_classes = "" -%}
|
|
17
|
+
{%- if item_padding | length > 0 -%}
|
|
18
|
+
{%- set item_classes = "p-section--" + item_padding -%}
|
|
19
|
+
{%- endif -%}
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
|
|
21
|
+
{#- Last item should not have any additional padding - the pattern itself already has bottom padding -#}
|
|
22
|
+
{%- if loop.last -%}
|
|
23
|
+
{%- set item_classes = "" -%}
|
|
24
|
+
{%- endif -%}
|
|
25
|
+
<div{%- if item_classes | length > 0 %} class="{{ item_classes }}"{%- endif -%}>
|
|
26
|
+
{{- basic_section_item(item) -}}
|
|
27
|
+
</div>
|
|
28
|
+
{%- endfor -%}
|
|
19
29
|
{% endmacro %}
|
|
20
30
|
|
|
31
|
+
{#-
|
|
32
|
+
This helper macro used to entirely implement the description block for this pattern.
|
|
33
|
+
The description block has since been upstreamed to `templates/_macros/shared/vf_description-block.jinja`.
|
|
34
|
+
Now, this helper serves as an adapter between the established API of the basic section and the description block.
|
|
35
|
+
-#}
|
|
36
|
+
{%-macro _basic_section_description(description_config={}) -%}
|
|
37
|
+
{{- vf_description_block(
|
|
38
|
+
type=description_config.get("type"),
|
|
39
|
+
content=description_config.get("content")
|
|
40
|
+
) -}}
|
|
41
|
+
{%- endmacro -%}
|
|
42
|
+
|
|
21
43
|
# image_config
|
|
22
44
|
# - aspect_ratio: "16-9" | "3-2" | "" (default is "")
|
|
23
45
|
# - caption_html: The HTML content for the caption of the image (optional). Will be wrapped in <figcaption>, and the image and caption will be wrapped in a <figure>.
|
|
@@ -145,110 +167,17 @@
|
|
|
145
167
|
</pre>
|
|
146
168
|
{% endmacro %}
|
|
147
169
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
#
|
|
153
|
-
# See https://vanillaframework.io/docs/patterns/logo-section#line-breaks
|
|
154
|
-
{% macro _basic_section_logo_block(logo_block_config={}) %}
|
|
155
|
-
{%- set is_fixed_width = logo_block_config.get("is_fixed_width", true) != false -%}
|
|
156
|
-
{%- if is_fixed_width -%}<div class="u-fixed-width">{%- endif -%}
|
|
157
|
-
<div class="p-logo-section">
|
|
158
|
-
{%- for logo in logo_block_config.get("logos", []) -%}
|
|
159
|
-
<div class="p-logo-section__item">
|
|
160
|
-
<img class="p-logo-section__logo {{ logo.get("attrs", {}).get("class", "") -}}"
|
|
161
|
-
{%- for attr, value in logo.get("attrs", {}).items() -%}
|
|
162
|
-
{% if attr != "class" %}
|
|
163
|
-
{{ attr }}="{{ value }}"
|
|
164
|
-
{%- endif -%}
|
|
165
|
-
{%- endfor -%}
|
|
166
|
-
/>
|
|
167
|
-
{%- if logo.get("has_line_break_after", false) -%}
|
|
168
|
-
<br class="u-hide--small">
|
|
169
|
-
{%- endif -%}
|
|
170
|
-
</div>
|
|
171
|
-
{%- endfor -%}
|
|
172
|
-
</div>
|
|
173
|
-
{%- if is_fixed_width -%}</div>{%- endif -%}
|
|
174
|
-
{% endmacro %}
|
|
175
|
-
|
|
176
|
-
# linked_logo_block_config
|
|
177
|
-
# - links (array) (required) : Array of links, each including 'href', 'label', 'text', and 'image_attrs'
|
|
178
|
-
{% macro _basic_section_linked_logo_block(linked_logo_block_config={}) %}
|
|
179
|
-
{{- vf_linked_logo_section(
|
|
180
|
-
links=linked_logo_block_config.get("links", []),
|
|
181
|
-
top_rule_variant="none",
|
|
182
|
-
padding="none"
|
|
183
|
-
) -}}
|
|
184
|
-
{% endmacro %}
|
|
185
|
-
|
|
186
|
-
# content_html: The inner HTML for the call-to-action button.
|
|
187
|
-
# button_type: "primary" | "secondary" (default is "primary")
|
|
188
|
-
# attrs: A dictionary of attributes to apply to the button or link.
|
|
189
|
-
{% macro _cta_button(content_html, button_type="", attrs={}) %}
|
|
190
|
-
{%- set cta_element_tag = "button" -%}
|
|
191
|
-
{%- if "href" in attrs and attrs.get("href", "") | length > 0 -%}
|
|
192
|
-
{%- set cta_element_tag = "a" -%}
|
|
193
|
-
{%- endif -%}
|
|
194
|
-
|
|
195
|
-
{%- if button_type not in ["primary", "secondary"] -%}
|
|
196
|
-
{%- set button_type = "" -%}
|
|
197
|
-
{%- endif -%}
|
|
198
|
-
|
|
199
|
-
{%- set cta_class = "" -%}
|
|
200
|
-
{%- if button_type == "primary" -%}
|
|
201
|
-
{%- set cta_class = "p-button--positive" -%}
|
|
202
|
-
{%- elif button_type == "secondary" -%}
|
|
203
|
-
{%- set cta_class = "p-button" -%}
|
|
204
|
-
{%- endif -%}
|
|
205
|
-
|
|
206
|
-
<{{ cta_element_tag }} class="{{ cta_class }} {{ attrs.get("class", "") }}"
|
|
207
|
-
{%- for attr, value in attrs.items() -%}
|
|
208
|
-
{% if attr != "class" %}
|
|
209
|
-
{{ attr }}="{{ value }}"
|
|
210
|
-
{%- endif -%}
|
|
211
|
-
{%- endfor -%}
|
|
212
|
-
>
|
|
213
|
-
{{- content_html | safe -}}
|
|
214
|
-
</{{ cta_element_tag }}>
|
|
215
|
-
{% endmacro %}
|
|
216
|
-
|
|
217
|
-
# cta_block_config
|
|
218
|
-
# - primary
|
|
219
|
-
# - content_html: The inner HTML for the primary call-to-action button.
|
|
220
|
-
# - attrs: A dictionary of attributes to apply to the primary button.
|
|
221
|
-
# - secondaries (generally, we recommend using 2):
|
|
222
|
-
# - content_html: The inner HTML for the secondary call-to-action button.
|
|
223
|
-
# - attrs: A dictionary of attributes to apply to the secondary button.
|
|
224
|
-
# - link
|
|
225
|
-
# - content_html: The inner HTML for the link.
|
|
226
|
-
# - attrs: A dictionary of attributes to apply to the link.
|
|
170
|
+
{#-
|
|
171
|
+
This helper macro used to entirely implement the cta block for this pattern.
|
|
172
|
+
The CTA block has since been upstreamed to `templates/_macros/shared/vf_cta-block.jinja`.
|
|
173
|
+
Now, this helper serves as an adapter between the established API of the basic section and the CTA block.
|
|
174
|
+
#}
|
|
227
175
|
{% macro _basic_section_cta_block(cta_block_config={}) %}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
button_type="primary"
|
|
234
|
-
) }}
|
|
235
|
-
{%- endif -%}
|
|
236
|
-
{%- if "secondaries" in cta_block_config %}
|
|
237
|
-
{%- for secondary in cta_block_config["secondaries"] -%}
|
|
238
|
-
{{ _cta_button(
|
|
239
|
-
content_html=secondary.get("content_html", ""),
|
|
240
|
-
attrs=secondary.get("attrs", {}),
|
|
241
|
-
button_type="secondary"
|
|
242
|
-
) }}
|
|
243
|
-
{%- endfor -%}
|
|
244
|
-
{%- endif -%}
|
|
245
|
-
{%- if "link" in cta_block_config %}
|
|
246
|
-
{{ _cta_button(
|
|
247
|
-
content_html=cta_block_config["link"].get("content_html", ""),
|
|
248
|
-
attrs=cta_block_config["link"].get("attrs", {})
|
|
249
|
-
) }}
|
|
250
|
-
{%- endif -%}
|
|
251
|
-
</div>
|
|
176
|
+
{{- vf_cta_block(
|
|
177
|
+
primary=cta_block_config.get("primary"),
|
|
178
|
+
secondaries=cta_block_config.get("secondaries"),
|
|
179
|
+
link=cta_block_config.get("link")
|
|
180
|
+
) -}}
|
|
252
181
|
{% endmacro %}
|
|
253
182
|
|
|
254
183
|
# item_config
|
|
@@ -268,9 +197,9 @@
|
|
|
268
197
|
{%- elif type == "code-block" -%}
|
|
269
198
|
{{- _basic_section_code_block(item_config.get("item", {})) -}}
|
|
270
199
|
{%- elif type =="logo-block" -%}
|
|
271
|
-
{{-
|
|
200
|
+
{{- vf_logo_block(item_config.get("item", {})) -}}
|
|
272
201
|
{%- elif type == "linked-logo-block" -%}
|
|
273
|
-
{{-
|
|
202
|
+
{{- vf_linked_logo_block(item_config.get("item", {})) -}}
|
|
274
203
|
{%- elif type == "cta-block" -%}
|
|
275
204
|
{{- _basic_section_cta_block(item_config.get("item", {})) -}}
|
|
276
205
|
{%- elif type == "notification" -%}
|
|
@@ -300,6 +229,7 @@
|
|
|
300
229
|
# padding: Type of padding to apply to the pattern - "deep", "shallow", "default" (default is "default").
|
|
301
230
|
# is_split_on_medium: Boolean to indicate if the section should be split on medium screens (default is false).
|
|
302
231
|
# top_rule_variant: Type of HR to render at the top of the pattern. "default" | "muted" (default is "default").
|
|
232
|
+
# attrs: A dictionary of attributes to apply to the section element.
|
|
303
233
|
{% macro vf_basic_section(
|
|
304
234
|
title={},
|
|
305
235
|
label_text="",
|
|
@@ -307,7 +237,8 @@
|
|
|
307
237
|
items=[],
|
|
308
238
|
padding="default",
|
|
309
239
|
is_split_on_medium=false,
|
|
310
|
-
top_rule_variant="default"
|
|
240
|
+
top_rule_variant="default",
|
|
241
|
+
attrs={}
|
|
311
242
|
) -%}
|
|
312
243
|
|
|
313
244
|
{%- set padding = padding | trim -%}
|
|
@@ -330,7 +261,13 @@
|
|
|
330
261
|
{%- set has_label = label_text|length > 0 -%}
|
|
331
262
|
{%- set has_subtitle = subtitle_text|length > 0 -%}
|
|
332
263
|
|
|
333
|
-
<section class="{{ padding_classes }}"
|
|
264
|
+
<section class="{{ padding_classes }} {{ attrs.get("class", "") -}}"
|
|
265
|
+
{%- for attr, value in attrs.items() -%}
|
|
266
|
+
{% if attr != "class" %}
|
|
267
|
+
{{ attr }}="{{ value }}"
|
|
268
|
+
{%- endif -%}
|
|
269
|
+
{%- endfor -%}
|
|
270
|
+
>
|
|
334
271
|
<div class="grid-row--50-50{%- if not is_split_on_medium -%}-on-large{%- endif -%}">
|
|
335
272
|
{{ vf_section_top_rule(top_rule_variant) }}
|
|
336
273
|
<div class="grid-col">
|
|
@@ -343,25 +280,7 @@
|
|
|
343
280
|
{%- if has_subtitle -%}
|
|
344
281
|
<p class="p-heading--{{ subtitle_heading_level }}">{{- subtitle_text -}}</p>
|
|
345
282
|
{%- endif -%}
|
|
346
|
-
{
|
|
347
|
-
{%- set item_padding = (item.get("padding", "")) | trim -%}
|
|
348
|
-
{%- if item_padding not in ["shallow"] -%}
|
|
349
|
-
{%- set item_padding="" -%}
|
|
350
|
-
{%- endif -%}
|
|
351
|
-
|
|
352
|
-
{%- set item_classes = "" -%}
|
|
353
|
-
{%- if item_padding | length > 0 -%}
|
|
354
|
-
{%- set item_classes = "p-section--" + item_padding -%}
|
|
355
|
-
{%- endif -%}
|
|
356
|
-
|
|
357
|
-
{#- Last item should not have any additional padding - the pattern itself already has bottom padding -#}
|
|
358
|
-
{%- if loop.last -%}
|
|
359
|
-
{%- set item_classes = "" -%}
|
|
360
|
-
{%- endif -%}
|
|
361
|
-
<div{%- if item_classes | length > 0 %} class="{{ item_classes }}"{%- endif -%}>
|
|
362
|
-
{{- basic_section_item(item) -}}
|
|
363
|
-
</div>
|
|
364
|
-
{%- endfor -%}
|
|
283
|
+
{{- vf_basic_section_blocks(items=items) -}}
|
|
365
284
|
</div>
|
|
366
285
|
</div>
|
|
367
286
|
</section>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% from "_macros/shared/vf_section_top_rule.jinja" import vf_section_top_rule %}
|
|
2
|
-
{
|
|
2
|
+
{%- from "_macros/shared/vf_blog-block.jinja" import vf_blog_block %}
|
|
3
3
|
|
|
4
4
|
# Params
|
|
5
5
|
# - article_config: A dictionary with the article configuration.
|
|
@@ -14,41 +14,8 @@
|
|
|
14
14
|
# - "date": A dictionary with "text" and optional "attrs" (a dictionary of time element attributes)
|
|
15
15
|
# - template_mode: Boolean indicating if the macro is being used in template mode (for dynamic loading scenarios).
|
|
16
16
|
# - fallback_image_url: URL to use as a fallback image, if no image is provided for an article.
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
{%- if not template_mode -%}
|
|
20
|
-
{%- set default_image_attrs = {
|
|
21
|
-
'src': fallback_image_url,
|
|
22
|
-
'alt': 'Blog fallback image'
|
|
23
|
-
}
|
|
24
|
-
-%}
|
|
25
|
-
{%- set input_image_attrs = article_config.get('image', {}).get('attrs', {}) -%}
|
|
26
|
-
{#- Merge user attributes over the defaults -#}
|
|
27
|
-
{%- set img_attrs = default_image_attrs.copy() -%}
|
|
28
|
-
{%- set _ = img_attrs.update(input_image_attrs) -%}
|
|
29
|
-
{#- class merging -#}
|
|
30
|
-
{%- set base_image_class = 'p-image-container__image' -%}
|
|
31
|
-
{%- set input_image_class = input_image_attrs.get('class', '') -%}
|
|
32
|
-
{%- if input_image_class -%}
|
|
33
|
-
{%- set final_image_classes = base_image_class + ' ' + input_image_class -%}
|
|
34
|
-
{%- else -%}
|
|
35
|
-
{%- set final_image_classes = base_image_class -%}
|
|
36
|
-
{%- endif -%}
|
|
37
|
-
{%- set _ = img_attrs.update({'class': final_image_classes}) -%}
|
|
38
|
-
{#- Build the HTML tag -#}
|
|
39
|
-
{%- set ns = namespace(image_html="<img") -%}
|
|
40
|
-
{%- for attr, value in img_attrs.items() -%}
|
|
41
|
-
{%- set ns.image_html = ns.image_html + " " + attr + "=\"" + value + "\"" -%}
|
|
42
|
-
{%- endfor -%}
|
|
43
|
-
{%- set image_html = ns.image_html + ">" -%}
|
|
44
|
-
{%- set _ = article_config.update({'image_html': '<div class="' + base_image_container_classes + '">\n ' + image_html + '\n </div>'}) -%}
|
|
45
|
-
{%- else -%}
|
|
46
|
-
{#- template mode - the template JS will fill in the image slot. -#}
|
|
47
|
-
{%- set _ = article_config.update({'image_html': '<div class="' + base_image_container_classes + '"></div>'}) -%}
|
|
48
|
-
{%- endif -%}
|
|
49
|
-
{{ vf_article_block(article_config=article_config, attrs={"class": "grid-col-2 grid-col-medium-2"}, template_mode=template_mode) }}
|
|
50
|
-
|
|
51
|
-
{%- endmacro -%}
|
|
17
|
+
{# moved article rendering and template/container logic into shared vf_blog-block.jinja
|
|
18
|
+
which exposes `vf_blog_block` for rendering the articles area. #}
|
|
52
19
|
|
|
53
20
|
# Params
|
|
54
21
|
# title: A dictionary with "text" and optional "link_attrs" (a dictionary of link attributes for the title).
|
|
@@ -116,18 +83,7 @@
|
|
|
116
83
|
{%- endif -%}
|
|
117
84
|
</h2>
|
|
118
85
|
</div>
|
|
119
|
-
{
|
|
120
|
-
<div id="{{ template_config.get("template_container_id", "articles") }}" class="p-blog__articles"></div>
|
|
121
|
-
<template style="display: none;" id="{{ template_config.get("template_id", "template") }}">
|
|
122
|
-
{{ _blog_article(template_mode=True) }}
|
|
123
|
-
</template>
|
|
124
|
-
{%- else -%}
|
|
125
|
-
<div class="p-blog__articles grid-row">
|
|
126
|
-
{%- for article in articles -%}
|
|
127
|
-
{{ _blog_article(article_config=article, fallback_image_url=fallback_image_url) }}
|
|
128
|
-
{%- endfor -%}
|
|
129
|
-
</div>
|
|
130
|
-
{%- endif -%}
|
|
86
|
+
{{ vf_blog_block(articles=articles, template_config=template_config, fallback_image_url=fallback_image_url) }}
|
|
131
87
|
</div>
|
|
132
88
|
</section>
|
|
133
89
|
{%- endmacro -%}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# title_text: H2 title text - optional
|
|
14
14
|
# variant: default
|
|
15
15
|
# layout: 100
|
|
16
|
+
# attrs: A dictionary of attributes to apply to the section element
|
|
16
17
|
|
|
17
18
|
# Slots:
|
|
18
19
|
# cta: The cta link - required
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
# description: Paragraph-style (one or more) content below the title - Optional
|
|
47
48
|
# cta: Call-to-action block (required)
|
|
48
49
|
|
|
49
|
-
{%- macro vf_cta_section(title_text, variant='default', layout='100', caller=None) -%}
|
|
50
|
+
{%- macro vf_cta_section(title_text, variant='default', layout='100', caller=None, attrs={}) -%}
|
|
50
51
|
{% set description_content = caller('description') %}
|
|
51
52
|
{% set has_description = description_content|trim|length > 0 %}
|
|
52
53
|
{% set cta_content = caller('cta') %}
|
|
@@ -88,7 +89,13 @@
|
|
|
88
89
|
{%- endif -%}
|
|
89
90
|
{%- endmacro -%}
|
|
90
91
|
<hr class="p-rule is-fixed-width u-no-margin--bottom" />
|
|
91
|
-
<section class="p-strip is-deep"
|
|
92
|
+
<section class="p-strip is-deep {{ attrs.get("class", "") -}}"
|
|
93
|
+
{%- for attr, value in attrs.items() -%}
|
|
94
|
+
{% if attr != "class" %}
|
|
95
|
+
{{ attr }}="{{ value }}"
|
|
96
|
+
{%- endif -%}
|
|
97
|
+
{%- endfor -%}
|
|
98
|
+
>
|
|
92
99
|
{%- if layout == "25-75" -%}
|
|
93
100
|
<div class="grid-row">
|
|
94
101
|
<div class="grid-col-start-large-3 grid-col-9">{{ _cta_variant() }}</div>
|
|
@@ -3,24 +3,9 @@
|
|
|
3
3
|
# - padding: Type of padding to apply to the pattern - "deep", "shallow", "default" (default is "default").
|
|
4
4
|
# - is_split_on_medium: Boolean to indicate if the section should be split on medium screens (default is false).
|
|
5
5
|
# - top_rule_variant: Type of HR to render at the top of the pattern. "default" | "muted" (default is "default").
|
|
6
|
-
{% from "_macros/vf_basic-section.jinja" import
|
|
6
|
+
{% from "_macros/vf_basic-section.jinja" import basic_section_title %}
|
|
7
7
|
{% from "_macros/shared/vf_section_top_rule.jinja" import vf_section_top_rule %}
|
|
8
|
-
|
|
9
|
-
{% macro _get_item_padding_classes(item_config={}, isLastLoopItr=False, isLastBlockItr=False) %}
|
|
10
|
-
{%- set item_padding = (item_config.get("padding", "")) | trim -%}
|
|
11
|
-
{%- if item_padding not in ["shallow"] -%}
|
|
12
|
-
{%- set item_padding = "" -%}
|
|
13
|
-
{%- endif -%}
|
|
14
|
-
{%- set item_classes = "" -%}
|
|
15
|
-
{%- if item_padding | length > 0 -%}
|
|
16
|
-
{%- set item_classes = "p-section--" + item_padding -%}
|
|
17
|
-
{%- endif -%}
|
|
18
|
-
{#- Last item of the last block should not have any bottom padding, as per desgin requirement -#}
|
|
19
|
-
{%- if isLastLoopItr and isLastBlockItr -%}
|
|
20
|
-
{%- set item_classes = "" -%}
|
|
21
|
-
{%- endif -%}
|
|
22
|
-
{{ item_classes | trim }}
|
|
23
|
-
{% endmacro %}
|
|
8
|
+
{% from "_macros/shared/vf_divided-section-block.jinja" import vf_divided_section_block %}
|
|
24
9
|
{% macro vf_divided_section(title, blocks=[], padding="default", is_split_on_medium=False, top_rule_variant="default", caller=None) %}
|
|
25
10
|
{%- set padding = padding | trim -%}
|
|
26
11
|
{%- if padding not in ["deep", "shallow", "default"] -%}
|
|
@@ -32,48 +17,11 @@
|
|
|
32
17
|
{%- endif -%}
|
|
33
18
|
<section class="{{ padding_classes }}">
|
|
34
19
|
<div class="grid-row--50-50{%- if not is_split_on_medium -%}-on-large{%- endif -%}">
|
|
35
|
-
{%- set description_block = blocks | selectattr("type", "equalto", "description-block") | first -%}
|
|
36
|
-
{%- set divided_blocks = blocks | selectattr("type", "equalto", "divided-block") | list -%}
|
|
37
20
|
{{ vf_section_top_rule(top_rule_variant) }}
|
|
38
21
|
<div class="grid-col">{{- basic_section_title(title) -}}</div>
|
|
39
22
|
<div class="grid-col">
|
|
40
|
-
{
|
|
41
|
-
{%- for item in description_block.get("items",[]) -%}
|
|
42
|
-
{% set item_classes = _get_item_padding_classes(item, loop.last) %}
|
|
43
|
-
<div {%- if item_classes | trim | length > 0 %}
|
|
44
|
-
class="{{ item_classes }}"
|
|
45
|
-
{%- endif -%}>{{- basic_section_item(item) -}}</div>
|
|
46
|
-
{%- endfor -%}
|
|
47
|
-
{%- if divided_blocks | length > 0 -%}<hr class="p-rule--muted" />{%- endif %}
|
|
48
|
-
{%- endif -%}
|
|
49
|
-
{%- for block in divided_blocks -%}
|
|
50
|
-
{%- set outer_last = loop.last -%}
|
|
51
|
-
{%- set ns = namespace(list_element="ul", list_class="p-list") -%}
|
|
52
|
-
{%- if block.get("bullet_type") == "number" -%}
|
|
53
|
-
{%- set ns.list_element = "ol" -%}
|
|
54
|
-
{%- set ns.list_class = "p-stepped-list" -%}
|
|
55
|
-
{%- endif -%}
|
|
56
|
-
<{{ ns.list_element }} class="p-divided__block {{ ns.list_class }} u-no-padding">
|
|
57
|
-
{%- for item in block.get("items",[]) -%}
|
|
58
|
-
{%- set list_bullet_type = "has-bullet" if block.bullet_type == "bullet" else "is-ticked" if block.bullet_type == "status" -%}
|
|
59
|
-
<li class="p-divided__heading u-no-padding--bottom {{ list_bullet_type }}{% if ns.list_class == 'p-stepped-list' %} p-stepped-list__item{% else %} p-list__item{% endif %}">
|
|
60
|
-
<div class="{% if not loop.last %}p-section--shallow{% endif %}{% if ns.list_class == 'p-stepped-list' %} p-stepped-list__title{% endif %}">
|
|
61
|
-
{%- if item.title_text -%}
|
|
62
|
-
<h3 class="p-heading--5 u-no-padding">{{ item.title_text }}</h3>
|
|
63
|
-
{%- endif -%}
|
|
64
|
-
{%- for content in item.contents -%}
|
|
65
|
-
{%- set item_classes = _get_item_padding_classes(content, loop.last, outer_last) -%}
|
|
66
|
-
<div {%- if item_classes | trim | length > 0 %}
|
|
67
|
-
class="{{ item_classes }}"
|
|
68
|
-
{%- endif -%}>{{- basic_section_item(content) -}}</div>
|
|
69
|
-
{%- endfor -%}
|
|
70
|
-
</div>
|
|
71
|
-
</li>
|
|
72
|
-
{% if not loop.last %}<hr class="p-rule--muted" />{% endif %}
|
|
73
|
-
{%- endfor -%}
|
|
74
|
-
</ {{ ns.list_element }}>
|
|
75
|
-
{%- endfor -%}
|
|
23
|
+
{{ vf_divided_section_block(blocks=blocks) }}
|
|
76
24
|
</div>
|
|
77
25
|
</div>
|
|
78
26
|
</section>
|
|
79
|
-
{% endmacro %}
|
|
27
|
+
{% endmacro %}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
{#- The vf_equal-heights-block has been abstracted to _macros/shared/ folder so that it can be nested and used in other components -#}
|
|
2
|
+
{% from "_macros/shared/vf_equal-heights-block.jinja" import vf_equal_heights_block %}
|
|
1
3
|
{#-
|
|
2
4
|
Params
|
|
3
5
|
- title_text (string) (required): The text to be displayed as the heading
|
|
6
|
+
- attrs (dictionary) (optional): A dictionary of attributes to apply to the equal heights pattern.
|
|
4
7
|
- subtitle_text (string) (optional): The text to be displayed as the subtitle
|
|
5
8
|
- subtitle_heading_level (int) (optional): The heading level for the subtitle. Can be 4 or 5. Defaults to 5.
|
|
6
9
|
- highlight_images (boolean) (optional): If the images need to be highlighted, which means adding a subtle grey background. Not added by default.
|
|
@@ -8,9 +11,11 @@
|
|
|
8
11
|
- image_aspect_ratio_medium (string) (optional): The aspect ratio for item images on medium screens. Defaults to "square". Can be "square", "2-3", "3-2", "16-9", "cinematic" or "auto". Defaults to "square".
|
|
9
12
|
- image_aspect_ratio_large (string) (optional): The aspect ratio for item images on large screens. Defaults to "2-3". Can be "square", "2-3", "3-2", "16-9", "cinematic" or "auto". Defaults to "2-3".
|
|
10
13
|
- items (array) (required): An array of items, each including 'image_html', 'title_text', 'description_html', and 'cta_html'.
|
|
11
|
-
|
|
14
|
+
-#}
|
|
15
|
+
|
|
12
16
|
{%- macro vf_equal_heights(
|
|
13
17
|
title_text,
|
|
18
|
+
attrs={},
|
|
14
19
|
subtitle_text="",
|
|
15
20
|
subtitle_heading_level=5,
|
|
16
21
|
highlight_images=false,
|
|
@@ -31,19 +36,25 @@
|
|
|
31
36
|
{% set subtitle_heading_level=5 %}
|
|
32
37
|
{%- endif -%}
|
|
33
38
|
|
|
34
|
-
<div class="p-section"
|
|
39
|
+
<div class="p-section {{ attrs.get('class', '') }}"
|
|
40
|
+
{%- for attr, value in attrs.items() -%}
|
|
41
|
+
{% if attr != 'class' %}
|
|
42
|
+
{{ attr }}="{{ value }}"
|
|
43
|
+
{%- endif -%}
|
|
44
|
+
{%- endfor -%}
|
|
45
|
+
>
|
|
35
46
|
<hr class="p-rule is-fixed-width"/>
|
|
36
47
|
<div class="p-section--shallow">
|
|
37
48
|
{%- if has_two_top_cols -%}
|
|
38
|
-
<div class="row--50-50-on-large">
|
|
39
|
-
<div class="col">
|
|
49
|
+
<div class="grid-row--50-50-on-large">
|
|
50
|
+
<div class="grid-col">
|
|
40
51
|
{%- endif -%}
|
|
41
52
|
<h2{% if not has_two_top_cols %} class="u-fixed-width"{% endif %}>{{ title_text }}</h2>
|
|
42
53
|
{%- if has_two_top_cols -%}
|
|
43
54
|
</div>
|
|
44
55
|
{%- endif -%}
|
|
45
56
|
{%- if has_two_top_cols -%}
|
|
46
|
-
<div class="col">
|
|
57
|
+
<div class="grid-col">
|
|
47
58
|
{%- if has_subtitle -%}
|
|
48
59
|
<p class="p-heading--{{ subtitle_heading_level }}">{{ subtitle_text }}</p>
|
|
49
60
|
{%- endif -%}
|
|
@@ -57,53 +68,22 @@
|
|
|
57
68
|
{%- endif -%}
|
|
58
69
|
</div>
|
|
59
70
|
|
|
60
|
-
<div class="row">
|
|
61
|
-
<div class="{%- if items | length == 2 -%}col-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<div class="p-equal-height-row__item">
|
|
71
|
-
{%- if image | length > 0 %}
|
|
72
|
-
<div
|
|
73
|
-
class="p-image-container {% if image_aspect_ratio_small != 'auto' %} p-image-container--{{ image_aspect_ratio_small }}-on-small{% endif %}{% if image_aspect_ratio_medium != 'auto' %} p-image-container--{{ image_aspect_ratio_medium }}-on-medium{% endif %}{% if image_aspect_ratio_large != 'auto' %} p-image-container--{{ image_aspect_ratio_large }}-on-large{% endif %} is-cover{% if highlight_images %} is-highlighted{% endif %}" >
|
|
74
|
-
{#- The consumer must pass in an img.p-image-container__image for the image to be properly formatted -#}
|
|
75
|
-
{{- image | safe -}}
|
|
76
|
-
</div>
|
|
77
|
-
<hr class="p-rule--highlight"/>
|
|
78
|
-
{%- endif -%}
|
|
79
|
-
</div>
|
|
80
|
-
{#- Title item -#}
|
|
81
|
-
<div class="p-equal-height-row__item">
|
|
82
|
-
{%- if title | length > 0 -%}
|
|
83
|
-
<p class="p-heading--{{ subtitle_heading_level }}">{{- title -}}</p>
|
|
84
|
-
{%- endif -%}
|
|
85
|
-
</div>
|
|
86
|
-
{#- Description item (optional) -#}
|
|
87
|
-
<div class="p-equal-height-row__item">
|
|
88
|
-
{{- description | safe -}}
|
|
89
|
-
</div>
|
|
90
|
-
{#- CTA item (optional) -#}
|
|
91
|
-
<div class="p-equal-height-row__item">
|
|
92
|
-
{%- if cta | length > 0 -%}
|
|
93
|
-
<p>
|
|
94
|
-
{{- cta | safe -}}
|
|
95
|
-
</p>
|
|
96
|
-
{%- endif -%}
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
{%- endfor -%}
|
|
100
|
-
</div>
|
|
71
|
+
<div class="grid-row">
|
|
72
|
+
<div class="{%- if items | length == 2 -%}grid-col-4 grid-col-start-large-5{%- elif items | length % 3 == 0 and items | length % 4 != 0 -%}grid-col-6 grid-col-start-large-3{%- else -%}grid-col-8{%- endif -%}">
|
|
73
|
+
{{ vf_equal_heights_block(
|
|
74
|
+
items=items,
|
|
75
|
+
subtitle_heading_level=subtitle_heading_level,
|
|
76
|
+
highlight_images=highlight_images,
|
|
77
|
+
image_aspect_ratio_small=image_aspect_ratio_small,
|
|
78
|
+
image_aspect_ratio_medium=image_aspect_ratio_medium,
|
|
79
|
+
image_aspect_ratio_large=image_aspect_ratio_large
|
|
80
|
+
) }}
|
|
101
81
|
</div>
|
|
102
82
|
</div>
|
|
103
83
|
{%- if has_cta -%}
|
|
104
|
-
<div class="row">
|
|
84
|
+
<div class="grid-row">
|
|
105
85
|
<hr class="p-rule--muted">
|
|
106
|
-
<div class="col-
|
|
86
|
+
<div class="grid-col-4 grid-col-medium-2 grid-col-start-large-5 grid-col-start-medium-3">
|
|
107
87
|
<p>
|
|
108
88
|
{{- cta_content -}}
|
|
109
89
|
</p>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
{% from "_macros/shared/vf_linked-logo-block.jinja" import vf_linked_logo_block %}
|
|
2
|
+
|
|
1
3
|
{#
|
|
2
4
|
Params
|
|
3
5
|
- title_text (string): The text to be displayed as the heading
|
|
@@ -59,35 +61,6 @@
|
|
|
59
61
|
{%- set padding_classes = "" -%}
|
|
60
62
|
{%- endif -%}
|
|
61
63
|
|
|
62
|
-
{% macro _list(links, cols_per_item=2) %}
|
|
63
|
-
{%- if links|length > 1 -%}
|
|
64
|
-
<div class="grid-row">
|
|
65
|
-
{%- for link in links -%}
|
|
66
|
-
<div class="grid-col-{{ cols_per_item }} grid-col-medium-{{ cols_per_item }}">
|
|
67
|
-
<a href="{{ link.href }}" aria-label="{{ link.label }}">
|
|
68
|
-
<div class="p-image-container--16-9 is-highlighted">
|
|
69
|
-
{#- If image_attrs is present, use it to generate the image HTML -#}
|
|
70
|
-
{%- if "image_attrs" in link -%}
|
|
71
|
-
<img class="p-image-container__image {{ link["image_attrs"]["class"] }}"
|
|
72
|
-
{% for attr, value in link["image_attrs"].items() %}
|
|
73
|
-
{% if attr != "class" %}
|
|
74
|
-
{{ attr }}="{{ value }}"
|
|
75
|
-
{% endif %}
|
|
76
|
-
{% endfor %}
|
|
77
|
-
>
|
|
78
|
-
{% else %}
|
|
79
|
-
{{ link.image_html | safe }}
|
|
80
|
-
{% endif %}
|
|
81
|
-
</div>
|
|
82
|
-
<hr class="p-rule--muted">
|
|
83
|
-
<p>{{ link.text }}</p>
|
|
84
|
-
</a>
|
|
85
|
-
</div>
|
|
86
|
-
{%- endfor -%}
|
|
87
|
-
</div>
|
|
88
|
-
{%- endif -%}
|
|
89
|
-
{% endmacro %}
|
|
90
|
-
|
|
91
64
|
{%- if padding == "none" -%}
|
|
92
65
|
<div>
|
|
93
66
|
{%- else -%}
|
|
@@ -105,7 +78,7 @@
|
|
|
105
78
|
</div>
|
|
106
79
|
{% endif %}
|
|
107
80
|
<div class="grid-col-4 grid-col-start-large-5 grid-col-medium-4 grid-col-start-medium-5">
|
|
108
|
-
{{
|
|
81
|
+
{{ vf_linked_logo_block({'links': links}) }}
|
|
109
82
|
</div>
|
|
110
83
|
</div>
|
|
111
84
|
</div>
|
|
@@ -118,7 +91,7 @@
|
|
|
118
91
|
</div>
|
|
119
92
|
{% endif %}
|
|
120
93
|
<div class="grid-col-6 grid-col-start-large-3">
|
|
121
|
-
{{
|
|
94
|
+
{{ vf_linked_logo_block({'links': links}) }}
|
|
122
95
|
</div>
|
|
123
96
|
</div>
|
|
124
97
|
</div>
|
|
@@ -130,7 +103,7 @@
|
|
|
130
103
|
</div>
|
|
131
104
|
</div>
|
|
132
105
|
{% endif %}
|
|
133
|
-
{{
|
|
106
|
+
{{ vf_linked_logo_block({'links': links}) }}
|
|
134
107
|
{%- endif -%}
|
|
135
108
|
{%- if padding == "none" -%}
|
|
136
109
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Params
|
|
3
3
|
- title_text (string) (required): The text to be displayed as the heading
|
|
4
4
|
- top_rule_variant (string) (optional): Variant of the top rule, default is "default". Options are "muted", "highlighted", "default", "none".
|
|
5
|
+
- attrs (dictionary) (optional): A dictionary of attributes to apply to the Pricing block section.
|
|
5
6
|
- tiers (Array<{
|
|
6
7
|
tier_name_text: String (optional),
|
|
7
8
|
tier_price_text: String,
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
{%- macro vf_pricing_block(
|
|
21
22
|
top_rule_variant="default",
|
|
22
23
|
title_text="",
|
|
24
|
+
attrs={},
|
|
23
25
|
tiers=[]
|
|
24
26
|
) -%}
|
|
25
27
|
{% set top_rule_variant = top_rule_variant | trim %}
|
|
@@ -86,7 +88,13 @@
|
|
|
86
88
|
<hr class="p-rule{% if top_rule_variant != 'default' %}--{{ rule_class }}{% endif %} is-fixed-width" />
|
|
87
89
|
{% endif %}
|
|
88
90
|
{%- endmacro -%}
|
|
89
|
-
<div class="p-section"
|
|
91
|
+
<div class="p-section {{ attrs.get("class", "") -}}"
|
|
92
|
+
{%- for attr, value in attrs.items() -%}
|
|
93
|
+
{% if attr != "class" %}
|
|
94
|
+
{{ attr }}="{{ value }}"
|
|
95
|
+
{%- endif -%}
|
|
96
|
+
{%- endfor -%}
|
|
97
|
+
>
|
|
90
98
|
{{ _top_rule() }}
|
|
91
99
|
<div class="grid-row">
|
|
92
100
|
<div class="grid-col-4 grid-col-medium-4 grid-col-small-4">
|