@nationalarchives/frontend 0.1.46 → 0.1.48
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/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/analytics.js +1 -1
- package/nationalarchives/analytics.js.map +1 -1
- package/nationalarchives/analytics.mjs +24 -12
- package/nationalarchives/components/breadcrumbs/template.njk +3 -3
- package/nationalarchives/components/card/template.njk +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.njk +11 -11
- package/nationalarchives/components/checkboxes/template.njk +1 -11
- package/nationalarchives/components/compound-filters/template.njk +4 -4
- package/nationalarchives/components/cookie-banner/template.njk +5 -5
- package/nationalarchives/components/date-search/date-search.njk +2 -2
- package/nationalarchives/components/error-summary/error-summary.css +1 -1
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
- package/nationalarchives/components/footer/analytics.js +1 -1
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/template.njk +7 -7
- package/nationalarchives/components/global-header/analytics.js +2 -0
- package/nationalarchives/components/global-header/fixtures.json +1 -1
- package/nationalarchives/components/global-header/global-header.js +1 -1
- package/nationalarchives/components/global-header/global-header.js.map +1 -1
- package/nationalarchives/components/global-header/global-header.mjs +15 -0
- package/nationalarchives/components/global-header/global-header.stories.js +18 -4
- package/nationalarchives/components/global-header/template.njk +4 -4
- package/nationalarchives/components/header/fixtures.json +1 -1
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +8 -0
- package/nationalarchives/components/header/template.njk +5 -5
- package/nationalarchives/components/hero/template.njk +11 -11
- package/nationalarchives/components/picture/template.njk +9 -9
- package/nationalarchives/components/quick-filters/template.njk +2 -2
- package/nationalarchives/components/radios/radios.njk +11 -11
- package/nationalarchives/components/radios/template.njk +1 -1
- package/nationalarchives/components/tabs/template.njk +4 -4
- package/nationalarchives/components/text-input/template.njk +1 -1
- package/nationalarchives/components/text-input/text-input.njk +10 -10
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +1 -1
- package/nationalarchives/templates/fixtures.json +1 -1
- package/nationalarchives/templates/list.njk +2 -2
- package/nationalarchives/utilities/_typography.scss +22 -6
- package/package.json +1 -1
@@ -4,26 +4,26 @@
|
|
4
4
|
<figure class="tna-picture {{ containerClasses | join(' ') }}" data-module="tna-picture"{% if params.informationLabelOpen %} data-informationlabelopen="{{ params.informationLabelOpen }}"{% endif %}{% if params.informationLabelClose %} data-informationlabelclose="{{ params.informationLabelClose }}"{% endif %}{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
5
5
|
<div class="tna-picture__image-wrapper tna-background-tint">
|
6
6
|
<picture>
|
7
|
-
{%- for source in params.sources
|
7
|
+
{%- for source in params.sources %}
|
8
8
|
<source class="tna-picture__image" media="{{ source.media }}" srcset="{{ source.src }}" width="{{ source.width }}" height="{{ source.height }}">
|
9
|
-
{%- endfor
|
9
|
+
{%- endfor %}
|
10
10
|
<img class="tna-picture__image" width="{{ params.width }}" height="{{ params.height }}" src="{{ params.src }}" alt="{{ params.alt }}" loading="lazy">
|
11
11
|
</picture>
|
12
12
|
</div>
|
13
|
-
{%- if params.information
|
13
|
+
{%- if params.information %}
|
14
14
|
<div class="tna-picture__transcript">
|
15
|
-
{%- if params.information | length > 1
|
15
|
+
{%- if params.information | length > 1 %}
|
16
16
|
{{ tnaTabs({
|
17
17
|
items: params.information
|
18
18
|
}) }}
|
19
|
-
{%- else
|
19
|
+
{%- else %}
|
20
20
|
{{ params.information[0]['body'] | safe }}
|
21
|
-
{%- endif
|
21
|
+
{%- endif %}
|
22
22
|
</div>
|
23
|
-
{%- endif
|
24
|
-
{%- if params.caption
|
23
|
+
{%- endif %}
|
24
|
+
{%- if params.caption %}
|
25
25
|
<figcaption class="tna-picture__caption">
|
26
26
|
{{ params.caption | safe }}
|
27
27
|
</figcaption>
|
28
|
-
{%- endif
|
28
|
+
{%- endif %}
|
29
29
|
</figure>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
2
|
<ul class="tna-quick-filters{% if params.stack %} tna-quick-filters--stacked{% endif %} {{ containerClasses | join(' ') }}"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
|
-
{%- for item in params.items
|
3
|
+
{%- for item in params.items %}
|
4
4
|
<li class="tna-quick-filters__item{%- if item.selected %} tna-quick-filters__item--selected{% endif %}">
|
5
5
|
<a href="{{ item.href }}" {%- if item.title %} title="{{ item.title }}"{% endif %} class="tna-quick-filters__link">{{ item.label }}</a>
|
6
6
|
</li>
|
7
|
-
{%- endfor
|
7
|
+
{%- endfor %}
|
8
8
|
</ul>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
10
|
-
{%- endfor %}
|
1
|
+
{%- macro tnaRadiosElement(params, extraAttributes) -%}
|
2
|
+
<div class="tna-radios{% if params.small or params.inline %} tna-radios--small{% endif %}{% if params.inline %} tna-radios--inline{% endif %}">
|
3
|
+
{%- for item in params.items %}
|
4
|
+
<div class="tna-radios__item">
|
5
|
+
<input type="radio" id="{{ params.id }}-{{ item.value }}" value="{{ item.value }}" name="{{ params.name }}"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% for attribute, value in extraAttributes %} {{ attribute }}="{{ value }}"{% endfor %}{% if params.selected and item.value === params.selected %} checked{% endif %}>
|
6
|
+
<label for="{{ params.id }}-{{ item.value }}" class="tna-radios__item-label">
|
7
|
+
{{ item.text }}
|
8
|
+
</label>
|
11
9
|
</div>
|
12
|
-
{
|
10
|
+
{%- endfor %}
|
11
|
+
</div>
|
12
|
+
{%- endmacro %}
|
@@ -4,17 +4,17 @@
|
|
4
4
|
{%- endif -%}
|
5
5
|
<div class="tna-tabs {{ containerClasses | join(' ') }}" data-module="tna-tabs"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
6
6
|
<ul class="tna-tabs__list">
|
7
|
-
{
|
7
|
+
{%- for item in params.items %}
|
8
8
|
<li class="tna-tabs__list-item">
|
9
9
|
<a href="#{{ item.id }}" class="tna-tabs__list-item-link" id="{{ item.id }}-tab">{{ item.title }}</a>
|
10
10
|
</li>
|
11
|
-
{
|
11
|
+
{%- endfor %}
|
12
12
|
</ul>
|
13
13
|
<div class="tna-tabs__items">
|
14
|
-
{
|
14
|
+
{%- for item in params.items %}
|
15
15
|
<section id="{{ item.id }}" class="tna-tabs__item">
|
16
16
|
{{ item.body | safe }}
|
17
17
|
</section>
|
18
|
-
{
|
18
|
+
{%- endfor %}
|
19
19
|
</div>
|
20
20
|
</div>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
{
|
1
|
+
{%- macro tnaTextInputElement(params, extraAttributes) -%}
|
2
|
+
{%- set inputClasses = [params.classes] if params.classes else [] -%}
|
3
|
+
<input type="text" id="{{ params.id }}" class="tna-text-input{% if params.size %} tna-text-input--{{ params.size }}{% endif %} {{ inputClasses | join(' ') }}" name="{{ params.name }}" value="{{ params.value }}" spellcheck="{{ params.spellcheck if params.spellcheck else false }}"
|
4
|
+
{%- if params.hint or params.error %} aria-describedby="{%- if params.hint -%}{{ params.id }}-hint{%- endif %} {% if params.error -%}{{ params.id }}-error{%- endif -%}"{%- endif %}
|
5
|
+
{%- if params.maxLength %} maxlength="{{ params.maxLength }}"{% endif %}
|
6
|
+
{%- if params.autofill %} autofill="{{ params.autofill }}"{% endif %}
|
7
|
+
{%- if params.inputmode %} inputmode="{{ params.inputmode }}"{% endif %}
|
8
|
+
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}
|
9
|
+
{%- for attribute, value in extraAttributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
10
|
+
{%- endmacro %}
|