@nationalarchives/frontend 0.1.16-prerelease → 0.1.17-prerelease
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 +13 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.scss +2 -3
- package/nationalarchives/assets/fonts/fa-brands-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +2 -2
- package/nationalarchives/components/button/_button-group.scss +18 -0
- package/nationalarchives/components/button/_index.scss +24 -7
- package/nationalarchives/components/button/button.stories.js +63 -6
- package/nationalarchives/components/button/fixtures.json +3 -3
- package/nationalarchives/components/button/macro-options.json +13 -1
- package/nationalarchives/components/button/template.njk +7 -2
- package/nationalarchives/components/card/_index.scss +62 -47
- package/nationalarchives/components/card/card.stories.js +59 -8
- package/nationalarchives/components/card/fixtures.json +59 -20
- package/nationalarchives/components/card/macro-options.json +14 -2
- package/nationalarchives/components/card/template.njk +12 -8
- package/nationalarchives/components/filters/_index.scss +19 -14
- package/nationalarchives/components/footer/_index.scss +194 -60
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +80 -71
- package/nationalarchives/components/footer/macro-options.json +34 -8
- package/nationalarchives/components/footer/template.njk +110 -53
- package/nationalarchives/components/header/_index.scss +40 -4
- package/nationalarchives/components/hero/_index.scss +1 -1
- package/nationalarchives/components/index-grid/_index.scss +27 -5
- package/nationalarchives/components/index-grid/index-grid.stories.js +25 -1
- package/nationalarchives/components/index-grid/macro-options.json +12 -0
- package/nationalarchives/components/index-grid/template.njk +9 -11
- package/nationalarchives/components/message/_index.scss +8 -0
- package/nationalarchives/components/picture/_index.scss +2 -0
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/picture/picture.mjs +2 -0
- package/nationalarchives/components/skip-link/skip-link.stories.js +3 -2
- package/nationalarchives/components/tabs/_index.scss +6 -3
- package/nationalarchives/components/tabs/tabs.stories.js +6 -6
- package/nationalarchives/lib/font-awesome/_animated.scss +276 -0
- package/nationalarchives/lib/font-awesome/_bordered-pulled.scss +20 -0
- package/nationalarchives/lib/font-awesome/_core.scss +42 -0
- package/nationalarchives/lib/font-awesome/_fixed-width.scss +7 -0
- package/nationalarchives/lib/font-awesome/_functions.scss +57 -0
- package/nationalarchives/lib/font-awesome/_icons.scss +11 -0
- package/nationalarchives/lib/font-awesome/_list.scss +20 -0
- package/nationalarchives/lib/font-awesome/_mixins.scss +74 -0
- package/nationalarchives/lib/font-awesome/_rotated-flipped.scss +31 -0
- package/nationalarchives/lib/font-awesome/_screen-reader.scss +14 -0
- package/nationalarchives/lib/font-awesome/_shims.scss +2653 -0
- package/nationalarchives/lib/font-awesome/_sizing.scss +16 -0
- package/nationalarchives/lib/font-awesome/_stacked.scss +32 -0
- package/nationalarchives/lib/font-awesome/_variables.scss +4976 -0
- package/nationalarchives/lib/font-awesome/brands.scss +34 -0
- package/nationalarchives/lib/font-awesome/fontawesome.scss +21 -0
- package/nationalarchives/lib/font-awesome/regular.scss +28 -0
- package/nationalarchives/lib/font-awesome/solid.scss +28 -0
- package/nationalarchives/lib/font-awesome/v4-shims.scss +11 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +22 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +483 -97
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +1 -1
- package/nationalarchives/stories/utilities/typography/typography.mdx +2 -0
- package/nationalarchives/stories/utilities/typography/typography.stories.js +20 -1
- package/nationalarchives/tools/_colour.scss +86 -41
- package/nationalarchives/tools/_typography.scss +13 -0
- package/nationalarchives/utilities/_font-awesome.scss +5 -0
- package/nationalarchives/utilities/_global.scss +70 -26
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +42 -10
- package/nationalarchives/utilities/_typography.scss +198 -59
- package/nationalarchives/variables/_assets.scss +1 -0
- package/nationalarchives/variables/_colour.scss +29 -23
- package/nationalarchives/variables/_index.scss +1 -0
- package/nationalarchives/variables/_spacing.scss +3 -1
- package/nationalarchives/variables/_typography.scss +4 -1
- package/package.json +13 -13
- package/nationalarchives/patterns/_index.scss +0 -1
- package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +0 -34
- package/nationalarchives/patterns/featured-collection/macro-options.json +0 -20
- package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
- package/nationalarchives/patterns/featured-collection/template.njk +0 -96
@@ -1,67 +1,124 @@
|
|
1
1
|
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
2
|
<footer class="tna-footer {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
<div class="tna-container">
|
4
|
+
<div class="tna-column tna-column--flex-1 tna-column--width-1-2-medium tna-column--full-small tna-column--full-tiny tna-column--order-1">
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" class="tna-logo" style="enable-background:new 0 0 160 160" viewBox="0 0 160 160" width="96" height="96">
|
6
|
+
<path fill="transparent" d="M0 0h160v160H0z" class="tna-logo__background"/>
|
7
|
+
<g class="tna-logo__foreground" fill="currentColor">
|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.1 1.1l-3.4.1c0-.2.1-.5.1-.7 0-1.7-.6-3.2-3-3.2-2.1 0-3 1.2-3 2.8 0 1.7.9 2.5 2.2 2.9l3.5 1.3c2.6 1 4.3 2.6 4.3 5.8 0 3.6-2.4 6.1-7 6.1-5.9 0-6.8-3.9-6.8-6.5 0-.3 0-.6.1-1l3.3-.1z"/>
|
10
|
+
</g>
|
11
|
+
</svg>
|
12
|
+
<h2 class="tna-heading tna-heading--l tna-footer__title">The National Archives</h2>
|
13
|
+
<address class="tna-footer__address">
|
14
|
+
Kew, Richmond<br />
|
15
|
+
TW9 4DU
|
16
|
+
</address>
|
17
|
+
{%- if params.meta -%}
|
18
|
+
<div class="tna-footer__meta">
|
19
|
+
{{ params.meta | safe }}
|
20
|
+
</div>
|
21
|
+
{%- endif -%}
|
22
|
+
{%- if params.social -%}
|
23
|
+
<nav class="tna-footer__social" aria-label="Social links">
|
24
|
+
<ul class="tna-ul tna-ul--plain tna-footer__social-items">
|
25
|
+
{%- for item in params.social -%}
|
26
|
+
<li class="tna-footer__social-item">
|
27
|
+
<a href="{{ item.href }}" class="tna-footer__social-item-link" {%- if item.title %}title="{{ item.title }}"{% endif %}>
|
28
|
+
{%- if item.image -%}
|
29
|
+
<img class="tna-footer__social-item-link-image" src="{{ item.image }}" alt="{{ item.text }} logo" width="32" height="32" />
|
30
|
+
<span class="tna-footer__social-item-link-text tna-visually-hidden">
|
31
|
+
{{ item.text }}
|
32
|
+
</span>
|
33
|
+
{%- else -%}
|
34
|
+
<span class="tna-footer__social-item-link-text">
|
35
|
+
{{ item.text }}
|
36
|
+
</span>
|
37
|
+
{%- endif -%}
|
38
|
+
</a>
|
39
|
+
</li>
|
40
|
+
{%- endfor -%}
|
41
|
+
</ul>
|
42
|
+
</nav>
|
43
|
+
{%- endif -%}
|
44
|
+
</div>
|
45
|
+
{%- if params.navigation -%}
|
46
|
+
<div class="tna-footer__navigation tna-column {% if params.showNewsletter %}tna-column--width-1-2{% else %}tna-column--width-2-3{% endif %} tna-column--full-medium tna-column--full-small tna-column--full-tiny tna-column--order-2 tna-column--order-4-medium tna-columns tna-columns--2 tna-columns--1-tiny">
|
47
|
+
{%- for group in params.navigation -%}
|
48
|
+
<nav class="tna-footer__navigation-block tna-columns__block" aria-label="{{ group.title }}">
|
49
|
+
<h3 class="tna-footer__navigation-block-heading tna-heading tna-heading--m">
|
50
|
+
{{ group.title }}
|
51
|
+
</h3>
|
52
|
+
<ul class="tna-footer__navigation-block-items tna-ul tna-ul--plain">
|
53
|
+
{%- for item in group.items -%}
|
54
|
+
<li class="tna-footer__navigation-block-item">
|
55
|
+
<a href="{{ item.href }}" class="tna-footer__navigation-block-item-link"{%- if item.title %} title="{{ item.title }}"{% endif %}{%- if item.newTab %} target="_blank"{% endif %}>
|
56
|
+
{{ item.text }}
|
57
|
+
{%- if item.newTab -%}
|
58
|
+
<span class="tna-footer__navigation-block-item-link-icon"></span>
|
59
|
+
<span class="tna-visually-hidden">(opens in new tab)</span>
|
60
|
+
{%- endif -%}
|
61
|
+
</a>
|
62
|
+
</li>
|
63
|
+
{%- endfor -%}
|
64
|
+
</ul>
|
65
|
+
</nav>
|
66
|
+
{%- endfor -%}
|
67
|
+
</div>
|
15
68
|
{%- endif -%}
|
69
|
+
{%- if params.showNewsletter -%}
|
70
|
+
<div class="tna-column tna-column--width-1-4 tna-column--width-1-2-medium tna-column--full-small tna-column--full-tiny tna-column--order-3">
|
71
|
+
<div class="tna-footer__mailing-list">
|
72
|
+
<h3 class="tna-footer__navigation-block-heading tna-heading tna-heading--m">
|
73
|
+
Join the National Archives' mailing list
|
74
|
+
</h3>
|
75
|
+
<p>
|
76
|
+
Subscribe for regular news, updates and priority booking for events.
|
77
|
+
</p>
|
78
|
+
<a href="#" class="tna-button tna-button--accent" role="button">
|
79
|
+
Subscribe
|
80
|
+
</a>
|
81
|
+
</div>
|
16
82
|
</div>
|
83
|
+
{%- endif -%}
|
17
84
|
</div>
|
18
|
-
|
19
|
-
{%- if params.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<a href="{{ item.href }}" class="tna-footer__navigation-group-item-link tna-footer__link" {%- if item.title %}title="{{ item.title }}"{% endif %}>{{ item.text }}</a>
|
85
|
+
<div class="tna-container">
|
86
|
+
{%- if params.legal -%}
|
87
|
+
<nav class="tna-footer__legal tna-column tna-column--full" aria-label="General site links">
|
88
|
+
<ul class="tna-footer__legal-items tna-ul tna-ul--plain">
|
89
|
+
{%- for item in params.legal -%}
|
90
|
+
<li class="tna-footer__legal-item">
|
91
|
+
<a href="{{ item.href }}" class="tna-footer__legal-item-link" {%- if item.title %} title="{{ item.title }}"{% endif %}>
|
92
|
+
{{ item.text }}
|
93
|
+
</a>
|
28
94
|
</li>
|
29
|
-
|
95
|
+
{%- endfor -%}
|
30
96
|
</ul>
|
97
|
+
<hr />
|
31
98
|
</nav>
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
{%- if params.social -%}
|
36
|
-
<nav class="tna-container tna-footer__social" aria-label="Social links">
|
37
|
-
{%- for item in params.social -%}
|
38
|
-
<div class="tna-column tna-column--flex-1 tna-column--width-1-4-small tna-column--width-1-2-tiny tna-footer__social-item">
|
39
|
-
<a href="{{ item.href }}" class="tna-footer__social-item-link tna-footer__link" {%- if item.title %}title="{{ item.title }}"{% endif %}>
|
40
|
-
{%- if item.image -%}
|
41
|
-
<img class="tna-footer__social-item-link-image" src="{{ item.image }}" alt="" width="40" height="40" />
|
42
|
-
{%- endif -%}
|
43
|
-
{{ item.text }}
|
44
|
-
</a>
|
99
|
+
{%- else -%}
|
100
|
+
<div class="tna-column--full">
|
101
|
+
<hr />
|
45
102
|
</div>
|
46
|
-
|
47
|
-
</
|
48
|
-
{%- endif -%}
|
103
|
+
{%- endif -%}
|
104
|
+
</div>
|
49
105
|
<div class="tna-container tna-footer__licence">
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
</svg>
|
54
|
-
</div>
|
55
|
-
<div class="tna-column tna-column--flex-1">
|
56
|
-
<p>All content is available under the <a href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" class="tna-footer__link">Open Government Licence v3.0</a>, except where otherwise stated</p>
|
57
|
-
</div>
|
58
|
-
<div class="tna-column tna-column--full-tiny tna-footer__govuk">
|
59
|
-
<a href="https://www.gov.uk/" class="tna-footer__govuk-link">
|
60
|
-
<svg class="tna-footer__govuk-logotype-crown" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 132 97" width="44" height="32">
|
61
|
-
<path fill="currentColor" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4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3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
|
106
|
+
<div class="tna-column tna-column--full-tiny">
|
107
|
+
<svg class="tna-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 483.2 195.7" width="60" height="24">
|
108
|
+
<path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"></path>
|
62
109
|
</svg>
|
63
|
-
|
64
|
-
|
110
|
+
</div>
|
111
|
+
<div class="tna-column tna-column--flex-1">
|
112
|
+
<p>All content is available under the <a href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" class="tna-footer__link">Open Government Licence v3.0</a>, except where otherwise stated</p>
|
113
|
+
</div>
|
114
|
+
<div class="tna-column tna-column--full-tiny tna-footer__govuk">
|
115
|
+
<a href="https://www.gov.uk/" class="tna-footer__govuk-link">
|
116
|
+
<svg class="tna-footer__govuk-logotype-crown" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 132 97" width="44" height="32">
|
117
|
+
<path fill="currentColor" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.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16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
|
118
|
+
</svg>
|
119
|
+
GOV.UK
|
120
|
+
</a>
|
121
|
+
</div>
|
65
122
|
</div>
|
66
123
|
</div>
|
67
124
|
</footer>
|
@@ -5,6 +5,43 @@
|
|
5
5
|
@use "../../tools/typography";
|
6
6
|
@use "../../tools/media";
|
7
7
|
|
8
|
+
// TODO: Only for the header component at the moment - remove on redesign
|
9
|
+
@mixin uninvert {
|
10
|
+
@include colour.colour-css-vars;
|
11
|
+
|
12
|
+
.tna-template--system-theme & {
|
13
|
+
@include colour.colour-css-vars;
|
14
|
+
|
15
|
+
@media (prefers-color-scheme: dark) {
|
16
|
+
@include colour.colour-css-vars-dark;
|
17
|
+
}
|
18
|
+
|
19
|
+
@media (prefers-contrast: more) {
|
20
|
+
@include colour.colour-css-vars-high-contrast;
|
21
|
+
}
|
22
|
+
|
23
|
+
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
|
24
|
+
@include colour.colour-css-vars-high-contrast-dark;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.tna-template--light-theme & {
|
29
|
+
@include colour.colour-css-vars;
|
30
|
+
}
|
31
|
+
|
32
|
+
.tna-template--dark-theme & {
|
33
|
+
@include colour.colour-css-vars-dark;
|
34
|
+
}
|
35
|
+
|
36
|
+
.tna-template--high-contrast-theme & {
|
37
|
+
@include colour.colour-css-vars-high-contrast;
|
38
|
+
}
|
39
|
+
|
40
|
+
.tna-template--high-contrast-theme.tna-template--dark-theme & {
|
41
|
+
@include colour.colour-css-vars-high-contrast-dark;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
8
45
|
.tna-header {
|
9
46
|
@include colour.invert;
|
10
47
|
|
@@ -344,8 +381,7 @@
|
|
344
381
|
&,
|
345
382
|
&:link,
|
346
383
|
&:visited {
|
347
|
-
text-decoration
|
348
|
-
text-decoration-thickness: 3px;
|
384
|
+
@include typography.interacted-text-decoration;
|
349
385
|
}
|
350
386
|
}
|
351
387
|
}
|
@@ -391,7 +427,7 @@
|
|
391
427
|
&,
|
392
428
|
&:link,
|
393
429
|
&:visited {
|
394
|
-
@include
|
430
|
+
@include uninvert;
|
395
431
|
@include colour.colour-font("font-dark");
|
396
432
|
@include colour.colour-background("page-background");
|
397
433
|
}
|
@@ -442,7 +478,7 @@
|
|
442
478
|
}
|
443
479
|
|
444
480
|
&__navigation {
|
445
|
-
@include
|
481
|
+
@include uninvert;
|
446
482
|
@include colour.colour-font("font-base");
|
447
483
|
@include typography.relative-font-size(20);
|
448
484
|
|
@@ -1,27 +1,39 @@
|
|
1
1
|
@use "sass:math";
|
2
2
|
@use "../../tools/colour";
|
3
|
+
@use "../../tools/media";
|
4
|
+
@use "../../tools/typography";
|
3
5
|
|
4
6
|
.tna-index-grid {
|
5
7
|
&__heading {
|
6
8
|
}
|
7
9
|
|
8
10
|
&__items {
|
9
|
-
margin-
|
11
|
+
margin-bottom: 0;
|
12
|
+
padding-top: 2rem;
|
10
13
|
|
11
14
|
list-style: none;
|
12
15
|
}
|
13
16
|
|
14
17
|
&__item-wrapper {
|
15
18
|
margin-bottom: 2rem;
|
19
|
+
|
20
|
+
@include media.on-mobile {
|
21
|
+
margin-bottom: 1rem;
|
22
|
+
}
|
16
23
|
}
|
17
24
|
|
18
25
|
&__item {
|
26
|
+
@include colour.invert;
|
27
|
+
|
28
|
+
// @include colour.colour-font("contrast-font-base");
|
29
|
+
|
19
30
|
height: 100%;
|
20
31
|
|
21
32
|
display: flex;
|
22
33
|
flex-direction: column;
|
23
34
|
|
24
|
-
|
35
|
+
position: relative;
|
36
|
+
|
25
37
|
text-decoration: none;
|
26
38
|
|
27
39
|
@include colour.on-high-contrast {
|
@@ -31,9 +43,10 @@
|
|
31
43
|
|
32
44
|
&__item-image {
|
33
45
|
width: 100%;
|
34
|
-
height: #{math.div(2, 3) * 100%};
|
46
|
+
// height: #{math.div(2, 3) * 100%};
|
47
|
+
height: auto;
|
35
48
|
|
36
|
-
object-fit: cover;
|
49
|
+
// object-fit: cover;
|
37
50
|
}
|
38
51
|
|
39
52
|
&__item-content {
|
@@ -42,19 +55,28 @@
|
|
42
55
|
flex: 1;
|
43
56
|
}
|
44
57
|
|
58
|
+
&__item-label {
|
59
|
+
position: absolute;
|
60
|
+
top: 0.5rem;
|
61
|
+
left: 0.5rem;
|
62
|
+
}
|
63
|
+
|
45
64
|
&__item-title {
|
65
|
+
// @include typography.heading-font;
|
46
66
|
text-decoration: underline;
|
67
|
+
// @include typography.relative-font-size(20);
|
47
68
|
|
48
69
|
.tna-index-grid__item:hover & {
|
49
70
|
&,
|
50
71
|
&:link,
|
51
72
|
&:visited {
|
52
|
-
text-decoration
|
73
|
+
@include typography.interacted-text-decoration;
|
53
74
|
}
|
54
75
|
}
|
55
76
|
}
|
56
77
|
|
57
78
|
&__item-subtitle {
|
58
79
|
@include colour.colour-font("font-light");
|
80
|
+
@include typography.relative-font-size(16);
|
59
81
|
}
|
60
82
|
}
|
@@ -53,13 +53,14 @@ const exampleItem = {
|
|
53
53
|
width: "800",
|
54
54
|
height: "600",
|
55
55
|
title: "Cat",
|
56
|
-
subtitle: "4 photos",
|
57
56
|
};
|
57
|
+
|
58
58
|
export const Standard = Template.bind({});
|
59
59
|
Standard.args = {
|
60
60
|
heading: {
|
61
61
|
title: "My dogs",
|
62
62
|
level: 2,
|
63
|
+
href: "#",
|
63
64
|
},
|
64
65
|
items: Array(12)
|
65
66
|
.fill({ ...exampleItem })
|
@@ -68,6 +69,7 @@ Standard.args = {
|
|
68
69
|
return {
|
69
70
|
...item,
|
70
71
|
href: `#/category-${index}`,
|
72
|
+
label: "Time period",
|
71
73
|
title: `Category #${index + 101}`,
|
72
74
|
subtitle: `${pseudoRandom} photos`,
|
73
75
|
};
|
@@ -78,3 +80,25 @@ Standard.args = {
|
|
78
80
|
columnsTiny: 1,
|
79
81
|
classes: "tna-index-grid--demo",
|
80
82
|
};
|
83
|
+
|
84
|
+
export const Basic = Template.bind({});
|
85
|
+
Basic.args = {
|
86
|
+
heading: {
|
87
|
+
title: "My dogs",
|
88
|
+
},
|
89
|
+
items: Array(6)
|
90
|
+
.fill({ ...exampleItem })
|
91
|
+
.map((item, index) => {
|
92
|
+
const pseudoRandom = ((index * 29) % 8) + 1;
|
93
|
+
return {
|
94
|
+
...item,
|
95
|
+
href: `#/category-${index}`,
|
96
|
+
title: `Category #${index + 101}`,
|
97
|
+
};
|
98
|
+
}),
|
99
|
+
columns: 3,
|
100
|
+
columnsMedium: 3,
|
101
|
+
columnsSmall: 2,
|
102
|
+
columnsTiny: 1,
|
103
|
+
classes: "tna-index-grid--demo",
|
104
|
+
};
|
@@ -22,6 +22,12 @@
|
|
22
22
|
"type": "text",
|
23
23
|
"required": false,
|
24
24
|
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "href",
|
28
|
+
"type": "text",
|
29
|
+
"required": false,
|
30
|
+
"description": ""
|
25
31
|
}
|
26
32
|
]
|
27
33
|
},
|
@@ -61,6 +67,12 @@
|
|
61
67
|
"required": true,
|
62
68
|
"description": ""
|
63
69
|
},
|
70
|
+
{
|
71
|
+
"name": "label",
|
72
|
+
"type": "string",
|
73
|
+
"required": false,
|
74
|
+
"description": ""
|
75
|
+
},
|
64
76
|
{
|
65
77
|
"name": "title",
|
66
78
|
"type": "string",
|
@@ -1,25 +1,23 @@
|
|
1
1
|
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
|
-
<nav class="tna-index-grid {{ containerClasses | join(' ') }}" aria-label="{{ params.heading }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
2
|
+
<nav class="tna-index-grid {{ containerClasses | join(' ') }}" aria-label="{{ params.heading.title }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
3
|
<div class="tna-container">
|
4
4
|
<div class="tna-column tna-column--full">
|
5
|
-
{
|
6
|
-
|
7
|
-
{
|
8
|
-
|
9
|
-
<h{{ params.heading.level }} class="tna-heading tna-heading--{{ headingSize }} tna-index-grid__heading">
|
5
|
+
<h{{ params.heading.level }} class="tna-heading tna-heading--{{ params.heading.size or 'l' }} tna-index-grid__heading">
|
6
|
+
{%- if params.heading.href -%}
|
7
|
+
<a href="{{ params.heading.href }}">{{ params.heading.title }}</a>
|
8
|
+
{%- else -%}
|
10
9
|
{{ params.heading.title }}
|
10
|
+
{%- endif -%}
|
11
11
|
</h{{ params.heading.level }}>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
14
|
<ul class="tna-index-grid__items tna-container">
|
15
15
|
{%- set itemClasses = ['tna-index-grid__item-wrapper', 'tna-column'] -%}
|
16
|
-
|
17
16
|
{%- if params.columns == 1 -%}
|
18
17
|
{%- set itemClasses = itemClasses.concat('tna-column--full') -%}
|
19
18
|
{%- else -%}
|
20
19
|
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columns) -%}
|
21
20
|
{%- endif -%}
|
22
|
-
|
23
21
|
{%- if params.columnsMedium -%}
|
24
22
|
{%- if params.columnsMedium == 1 -%}
|
25
23
|
{%- set itemClasses = itemClasses.concat('tna-column--full-medium') -%}
|
@@ -27,7 +25,6 @@
|
|
27
25
|
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsMedium + '-medium') -%}
|
28
26
|
{%- endif -%}
|
29
27
|
{%- endif -%}
|
30
|
-
|
31
28
|
{%- if params.columnsSmall -%}
|
32
29
|
{%- if params.columnsSmall == 1 -%}
|
33
30
|
{%- set itemClasses = itemClasses.concat('tna-column--full-small') -%}
|
@@ -35,7 +32,6 @@
|
|
35
32
|
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsSmall + '-small') -%}
|
36
33
|
{%- endif -%}
|
37
34
|
{%- endif -%}
|
38
|
-
|
39
35
|
{%- if params.columnsTiny -%}
|
40
36
|
{%- if params.columnsTiny == 1 -%}
|
41
37
|
{%- set itemClasses = itemClasses.concat('tna-column--full-tiny') -%}
|
@@ -43,13 +39,15 @@
|
|
43
39
|
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsTiny + '-tiny') -%}
|
44
40
|
{%- endif -%}
|
45
41
|
{%- endif -%}
|
46
|
-
|
47
42
|
{%- for item in params.items -%}
|
48
43
|
<li class="{{ itemClasses | join(' ') }}">
|
49
44
|
<a href="{{ item.href }}" class="tna-index-grid__item" title="{{ item.title }}">
|
50
45
|
<img src="{{ item.src }}" class="tna-index-grid__item-image" width="{{ item.width }}" height="{{ item.height }}" alt="{{ item.alt }}" />
|
51
46
|
<span class="tna-index-grid__item-content">
|
52
47
|
<span class="tna-index-grid__item-title">{{ item.title }}</span>
|
48
|
+
{%- if item.label -%}
|
49
|
+
<span class="tna-chip tna-index-grid__item-label">{{ item.label }}<span class="tna-visually-hidden">:</span></span>
|
50
|
+
{%- endif -%}
|
53
51
|
{%- if item.subtitle -%}
|
54
52
|
<br>
|
55
53
|
<span class="tna-index-grid__item-subtitle">{{ item.subtitle }}</span>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
@use "../../tools/colour";
|
2
|
+
@use "../../tools/media";
|
2
3
|
|
3
4
|
.tna-message {
|
4
5
|
padding: 1rem;
|
@@ -20,8 +21,15 @@
|
|
20
21
|
|
21
22
|
&__icon {
|
22
23
|
margin-right: 1rem;
|
24
|
+
|
25
|
+
flex: 0 0 2.5rem;
|
26
|
+
|
27
|
+
@include media.on-mobile {
|
28
|
+
flex: 0 0 1.5rem;
|
29
|
+
}
|
23
30
|
}
|
24
31
|
|
25
32
|
&__message {
|
33
|
+
flex: 1;
|
26
34
|
}
|
27
35
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():(t.TNAFrontend=t.TNAFrontend||{},t.TNAFrontend["components/picture/picture"]=e())}(self,(()=>(()=>{"use strict";var t={948:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{Picture:()=>o});var t=r(948);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===e(o)?o:String(o)),i)}var o}var o=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.$imageWrapper=t&&t.querySelector(".tna-picture__image-wrapper"),this.$transcript=t&&t.querySelector(".tna-picture__transcript"),this.transcriptOpened=!1}var r,n;return r=e,(n=[{key:"init",value:function(){var e=this;if(this.$module&&this.$imageWrapper&&this.$transcript){var r="tna-picture-".concat((0,t.Z)());this.$transcriptToggle=document.createElement("button"),this.$transcriptToggle.classList.add("tna-picture__toggle-transcript","tna-button"),this.$transcriptToggle.setAttribute("aria-controls",r),this.$transcriptToggle.setAttribute("aria-expanded",!1),this.$transcriptToggle.innerText="Open transcript",this.$transcriptToggle.addEventListener("click",(function(){return e.handleToggleTranscript()})),this.$imageWrapper.appendChild(this.$transcriptToggle),this.$transcript.setAttribute("id",r),this.$transcript.setAttribute("hidden",!0)}}},{key:"handleToggleTranscript",value:function(){var t="tna-picture__toggle-transcript--opened";this.transcriptOpened=!this.transcriptOpened,this.transcriptOpened?(this.$transcriptToggle.classList.add(t),this.$transcriptToggle.setAttribute("aria-expanded",!0),this.$transcriptToggle.innerText="Close transcript",this.$transcript.removeAttribute("hidden")):(this.$transcriptToggle.classList.remove(t),this.$transcriptToggle.setAttribute("aria-expanded",!1),this.$transcriptToggle.innerText="Open transcript",this.$transcript.setAttribute("hidden",!0))}}])&&i(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}()})(),n})()));
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():(t.TNAFrontend=t.TNAFrontend||{},t.TNAFrontend["components/picture/picture"]=e())}(self,(()=>(()=>{"use strict";var t={948:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{Picture:()=>o});var t=r(948);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===e(o)?o:String(o)),i)}var o}var o=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.$imageWrapper=t&&t.querySelector(".tna-picture__image-wrapper"),this.$transcript=t&&t.querySelector(".tna-picture__transcript"),this.transcriptOpened=!1}var r,n;return r=e,(n=[{key:"init",value:function(){var e=this;if(this.$module&&this.$imageWrapper&&this.$transcript){var r="tna-picture-".concat((0,t.Z)());this.$transcriptToggle=document.createElement("button"),this.$transcriptToggle.classList.add("tna-picture__toggle-transcript","tna-button","tna-button--accent","tna-button--solid-hover"),this.$transcriptToggle.setAttribute("aria-controls",r),this.$transcriptToggle.setAttribute("aria-expanded",!1),this.$transcriptToggle.innerText="Open transcript",this.$transcriptToggle.addEventListener("click",(function(){return e.handleToggleTranscript()})),this.$imageWrapper.appendChild(this.$transcriptToggle),this.$transcript.setAttribute("id",r),this.$transcript.setAttribute("hidden",!0)}}},{key:"handleToggleTranscript",value:function(){var t="tna-picture__toggle-transcript--opened";this.transcriptOpened=!this.transcriptOpened,this.transcriptOpened?(this.$transcriptToggle.classList.add(t),this.$transcriptToggle.setAttribute("aria-expanded",!0),this.$transcriptToggle.innerText="Close transcript",this.$transcript.removeAttribute("hidden")):(this.$transcriptToggle.classList.remove(t),this.$transcriptToggle.setAttribute("aria-expanded",!1),this.$transcriptToggle.innerText="Open transcript",this.$transcript.setAttribute("hidden",!0))}}])&&i(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}()})(),n})()));
|
2
2
|
//# sourceMappingURL=picture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"components/picture/picture.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAO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s","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/picture/picture.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = root[\"TNAFrontend\"] || {}, root[\"TNAFrontend\"][\"components/picture/picture\"] = factory();\n})(self, () => {\nreturn ","const uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Picture {\n constructor($module) {\n this.$module = $module;\n this.$imageWrapper =\n $module && $module.querySelector(\".tna-picture__image-wrapper\");\n this.$transcript =\n $module && $module.querySelector(\".tna-picture__transcript\");\n this.transcriptOpened = false;\n }\n\n init() {\n if (!this.$module || !this.$imageWrapper || !this.$transcript) {\n return;\n }\n\n const uniqueId = `tna-picture-${uuidv4()}`;\n\n this.$transcriptToggle = document.createElement(\"button\");\n this.$transcriptToggle.classList.add(\n \"tna-picture__toggle-transcript\",\n \"tna-button\",\n \"tna-button--accent\",\n \"tna-button--solid-hover\",\n );\n this.$transcriptToggle.setAttribute(\"aria-controls\", uniqueId);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", false);\n this.$transcriptToggle.innerText = \"Open transcript\";\n this.$transcriptToggle.addEventListener(\"click\", () =>\n this.handleToggleTranscript(),\n );\n this.$imageWrapper.appendChild(this.$transcriptToggle);\n\n this.$transcript.setAttribute(\"id\", uniqueId);\n this.$transcript.setAttribute(\"hidden\", true);\n // this.$transcript.setAttribute(\"tabindex\", \"-1\");\n }\n\n handleToggleTranscript() {\n const transcriptToggleOpenedClass =\n \"tna-picture__toggle-transcript--opened\";\n this.transcriptOpened = !this.transcriptOpened;\n if (this.transcriptOpened) {\n this.$transcriptToggle.classList.add(transcriptToggleOpenedClass);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", true);\n this.$transcriptToggle.innerText = \"Close transcript\";\n this.$transcript.removeAttribute(\"hidden\");\n // this.$transcript.setAttribute(\"tabindex\", \"0\");\n // this.$transcript.focus();\n } else {\n this.$transcriptToggle.classList.remove(transcriptToggleOpenedClass);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", false);\n this.$transcriptToggle.innerText = \"Open transcript\";\n this.$transcript.setAttribute(\"hidden\", true);\n // this.$transcript.setAttribute(\"tabindex\", \"-1\");\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","replace","c","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Picture","$module","_classCallCheck","this","$imageWrapper","querySelector","$transcript","transcriptOpened","_this","uniqueId","concat","uuidv4","$transcriptToggle","document","createElement","classList","add","setAttribute","innerText","addEventListener","handleToggleTranscript","appendChild","transcriptToggleOpenedClass","removeAttribute","remove"],"sourceRoot":""}
|
@@ -21,6 +21,8 @@ export class Picture {
|
|
21
21
|
this.$transcriptToggle.classList.add(
|
22
22
|
"tna-picture__toggle-transcript",
|
23
23
|
"tna-button",
|
24
|
+
"tna-button--accent",
|
25
|
+
"tna-button--solid-hover",
|
24
26
|
);
|
25
27
|
this.$transcriptToggle.setAttribute("aria-controls", uniqueId);
|
26
28
|
this.$transcriptToggle.setAttribute("aria-expanded", false);
|
@@ -18,12 +18,13 @@ export default {
|
|
18
18
|
};
|
19
19
|
|
20
20
|
const Template = ({ classes, attributes }) =>
|
21
|
-
|
21
|
+
`<p>To view the skip link component tab to this example, or click inside this example and press tab.</p>
|
22
|
+
${SkipLink({
|
22
23
|
params: {
|
23
24
|
classes,
|
24
25
|
attributes,
|
25
26
|
},
|
26
|
-
})}
|
27
|
+
})}`;
|
27
28
|
|
28
29
|
export const Standard = Template.bind({});
|
29
30
|
Standard.args = {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
@use "../../tools/colour";
|
2
|
+
@use "../../tools/typography";
|
2
3
|
|
3
4
|
.tna-tabs {
|
4
5
|
margin-bottom: 2rem;
|
@@ -34,9 +35,11 @@
|
|
34
35
|
position: relative;
|
35
36
|
|
36
37
|
@include colour.colour-font("font-dark");
|
37
|
-
font-size: inherit;
|
38
|
-
font-
|
39
|
-
font-
|
38
|
+
// font-size: inherit;
|
39
|
+
@include typography.relative-font-size(20);
|
40
|
+
// font-family: inherit;
|
41
|
+
@include typography.heading-font;
|
42
|
+
// font-weight: 700;
|
40
43
|
text-decoration: none;
|
41
44
|
line-height: 1.5;
|
42
45
|
text-align: center;
|