@nationalarchives/frontend 0.1.9-prerelease → 0.1.11-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/README.md +3 -3
- package/govuk-prototype-kit.config.json +0 -3
- package/nationalarchives/_features.scss +4 -0
- 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/all.mjs +54 -3
- package/nationalarchives/all.scss +8 -4
- package/nationalarchives/assets/images/footer/facebook.svg +11 -0
- package/nationalarchives/assets/images/footer/flickr.svg +11 -0
- package/nationalarchives/assets/images/footer/instagram.svg +17 -0
- package/nationalarchives/assets/images/footer/rss.svg +13 -0
- package/nationalarchives/assets/images/footer/twitter.svg +14 -0
- package/nationalarchives/assets/images/footer/youtube.svg +12 -0
- package/nationalarchives/assets/images/tna-square-logo.svg +5 -24
- package/nationalarchives/components/_index.scss +13 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +28 -6
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -2
- package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
- package/nationalarchives/components/breadcrumbs/macro.njk +1 -1
- package/nationalarchives/components/breadcrumbs/template.njk +14 -13
- package/nationalarchives/components/button/_index.scss +23 -11
- package/nationalarchives/components/button/button.stories.js +1 -2
- package/nationalarchives/components/button/fixtures.json +5 -5
- package/nationalarchives/components/button/macro.njk +1 -1
- package/nationalarchives/components/card/_index.scss +51 -7
- package/nationalarchives/components/card/card.js +2 -0
- package/nationalarchives/components/card/card.js.map +1 -0
- package/nationalarchives/components/card/card.mjs +45 -0
- package/nationalarchives/components/card/card.stories.js +18 -15
- package/nationalarchives/components/card/fixtures.json +14 -12
- package/nationalarchives/components/card/macro-options.json +18 -0
- package/nationalarchives/components/card/macro.njk +1 -1
- package/nationalarchives/components/card/template.njk +9 -4
- package/nationalarchives/components/filters/filters.stories.js +1 -2
- package/nationalarchives/components/filters/macro.njk +1 -1
- package/nationalarchives/components/filters/template.njk +2 -2
- package/nationalarchives/components/footer/_index.scss +68 -13
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +20 -23
- package/nationalarchives/components/footer/macro-options.json +12 -6
- package/nationalarchives/components/footer/macro.njk +1 -1
- package/nationalarchives/components/footer/template.njk +26 -16
- package/nationalarchives/components/grid/_index.scss +10 -12
- package/nationalarchives/components/grid/fixtures.json +12 -12
- package/nationalarchives/components/grid/grid.stories.js +56 -3
- package/nationalarchives/components/grid/macro-options.json +30 -0
- package/nationalarchives/components/grid/macro.njk +1 -1
- package/nationalarchives/components/grid/template.njk +17 -1
- package/nationalarchives/components/header/_index.scss +269 -60
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +7 -12
- package/nationalarchives/components/header/header.stories.js +156 -6
- package/nationalarchives/components/header/macro-options.json +83 -5
- package/nationalarchives/components/header/macro.njk +1 -1
- package/nationalarchives/components/header/template.njk +45 -36
- package/nationalarchives/components/hero/_index.scss +36 -6
- package/nationalarchives/components/hero/fixtures.json +16 -1
- package/nationalarchives/components/hero/hero.stories.js +32 -16
- package/nationalarchives/components/hero/macro-options.json +14 -2
- package/nationalarchives/components/hero/macro.njk +1 -1
- package/nationalarchives/components/hero/template.njk +7 -5
- package/nationalarchives/components/phase-banner/_index.scss +60 -0
- package/nationalarchives/components/phase-banner/fixtures.json +81 -0
- package/nationalarchives/components/phase-banner/macro-options.json +26 -0
- package/nationalarchives/components/phase-banner/macro.njk +3 -0
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +64 -0
- package/nationalarchives/components/phase-banner/template.njk +16 -0
- package/nationalarchives/components/picture/_index.scss +77 -0
- package/nationalarchives/components/picture/fixtures.json +4 -0
- package/nationalarchives/components/picture/macro-options.json +88 -0
- package/nationalarchives/components/picture/macro.njk +3 -0
- package/nationalarchives/components/picture/picture.js +2 -0
- package/nationalarchives/components/picture/picture.js.map +1 -0
- package/nationalarchives/components/picture/picture.mjs +57 -0
- package/nationalarchives/components/picture/picture.stories.js +63 -0
- package/nationalarchives/components/picture/template.njk +42 -0
- package/nationalarchives/components/profile/_index.scss +2 -0
- package/nationalarchives/components/profile/fixtures.json +4 -0
- package/nationalarchives/components/profile/macro-options.json +14 -0
- package/nationalarchives/components/profile/macro.njk +3 -0
- package/nationalarchives/components/profile/profile.stories.js +32 -0
- package/nationalarchives/components/profile/template.njk +15 -0
- package/nationalarchives/components/sensitive-image/fixtures.json +3 -3
- package/nationalarchives/components/sensitive-image/macro.njk +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -2
- package/nationalarchives/components/tabs/_index.scss +148 -0
- package/nationalarchives/components/tabs/fixtures.json +4 -0
- package/nationalarchives/components/tabs/macro-options.json +52 -0
- package/nationalarchives/components/tabs/macro.njk +3 -0
- package/nationalarchives/components/tabs/tabs.js +2 -0
- package/nationalarchives/components/tabs/tabs.js.map +1 -0
- package/nationalarchives/components/tabs/tabs.mjs +214 -0
- package/nationalarchives/components/tabs/tabs.stories.js +302 -0
- package/nationalarchives/components/tabs/template.njk +20 -0
- package/nationalarchives/patterns/_index.scss +1 -0
- package/nationalarchives/patterns/featured-collection/_index.scss +13 -0
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +35 -0
- package/nationalarchives/patterns/featured-collection/macro-options.json +20 -0
- package/nationalarchives/patterns/featured-collection/macro.njk +3 -0
- package/nationalarchives/patterns/featured-collection/template.njk +96 -0
- package/nationalarchives/stories/development/contributing.mdx +39 -0
- package/nationalarchives/stories/development/dependencies.mdx +2 -0
- package/nationalarchives/stories/development/technologies.mdx +65 -0
- package/nationalarchives/stories/utilities/colour.stories.js +189 -0
- package/nationalarchives/stories/utilities/typography.mdx +1 -0
- package/nationalarchives/stories/utilities/typography.stories.js +15 -0
- package/nationalarchives/templates/layouts/_generic.njk +1 -1
- package/nationalarchives/tools/_assets.scss +5 -0
- package/nationalarchives/tools/_colour.scss +129 -0
- package/nationalarchives/tools/_grid.scss +2 -2
- package/nationalarchives/tools/_index.scss +5 -0
- package/nationalarchives/tools/_media.scss +12 -11
- package/nationalarchives/tools/_typography.scss +15 -0
- package/nationalarchives/utilities/_debug.scss +11 -0
- package/nationalarchives/utilities/_global.scss +120 -3
- package/nationalarchives/utilities/_index.scss +3 -0
- package/nationalarchives/utilities/_typography.scss +155 -111
- package/nationalarchives/variables/_assets.scss +1 -0
- package/nationalarchives/variables/_colour.scss +120 -11
- package/nationalarchives/variables/{_all.scss → _index.scss} +1 -0
- package/nationalarchives/variables/_media.scss +39 -11
- package/nationalarchives/variables/_typography.scss +1 -1
- package/package.json +18 -15
- package/nationalarchives/components/_all.scss +0 -7
- package/nationalarchives/stories/development/structure.mdx +0 -7
- package/nationalarchives/tools/_all.scss +0 -3
- package/nationalarchives/utilities/_all.scss +0 -2
@@ -1,6 +1,6 @@
|
|
1
|
-
{%- set
|
2
|
-
<header class="tna-hero {{
|
3
|
-
<img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-hero__image">
|
1
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
|
+
<header class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
|
+
<img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-hero__image" width="{{ params.image.width }}" height="{{ params.image.height }}">
|
4
4
|
{%- if params.image.information -%}
|
5
5
|
<details class="tna-hero__image-details">
|
6
6
|
<summary class="tna-hero__image-details-summary">
|
@@ -19,13 +19,15 @@
|
|
19
19
|
{{ params.heading }}
|
20
20
|
</h1>
|
21
21
|
{%- endif -%}
|
22
|
-
<div class="tna-hero__body">
|
23
22
|
{%- if params.text -%}
|
23
|
+
<div class="tna-hero__body">
|
24
24
|
<p>{{ params.text }}</p>
|
25
|
+
</div>
|
25
26
|
{%- elseif params.body -%}
|
27
|
+
<div class="tna-hero__body">
|
26
28
|
{{ params.body | safe }}
|
27
|
-
{%- endif -%}
|
28
29
|
</div>
|
30
|
+
{%- endif -%}
|
29
31
|
</div>
|
30
32
|
</div>
|
31
33
|
</div>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
@use "../../tools/colour";
|
2
|
+
@use "../../tools/media";
|
3
|
+
@use "../../tools/typography";
|
4
|
+
|
5
|
+
.tna-phase-banner {
|
6
|
+
@include colour.fixed;
|
7
|
+
|
8
|
+
padding-top: 0.375rem;
|
9
|
+
padding-bottom: 0.375rem;
|
10
|
+
|
11
|
+
background-color: #d9d9d6;
|
12
|
+
|
13
|
+
.tna-container {
|
14
|
+
align-items: center;
|
15
|
+
flex-wrap: nowrap;
|
16
|
+
|
17
|
+
// @include media.on-tiny {
|
18
|
+
// flex-wrap: wrap;
|
19
|
+
// }
|
20
|
+
}
|
21
|
+
|
22
|
+
&__phase {
|
23
|
+
margin: 0.25rem 0;
|
24
|
+
padding: 0 0.5rem;
|
25
|
+
|
26
|
+
display: block;
|
27
|
+
|
28
|
+
font-weight: 700;
|
29
|
+
text-transform: uppercase;
|
30
|
+
line-height: 1.5;
|
31
|
+
|
32
|
+
background-color: #fff;
|
33
|
+
}
|
34
|
+
|
35
|
+
&__message {
|
36
|
+
margin: 0.25rem 0;
|
37
|
+
|
38
|
+
// @include typography.relative-font-size(14);
|
39
|
+
|
40
|
+
a {
|
41
|
+
color: inherit;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
&--discovery {
|
46
|
+
background-color: #fad3d4;
|
47
|
+
}
|
48
|
+
|
49
|
+
&--alpha {
|
50
|
+
background-color: #f9e1bc;
|
51
|
+
}
|
52
|
+
|
53
|
+
&--beta {
|
54
|
+
background-color: #f9f7e2;
|
55
|
+
}
|
56
|
+
|
57
|
+
&--live {
|
58
|
+
background-color: #dde5d5;
|
59
|
+
}
|
60
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
{
|
2
|
+
"component": "phase-banner",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "discovery",
|
6
|
+
"options": {
|
7
|
+
"phase": "discovery",
|
8
|
+
"message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
|
9
|
+
},
|
10
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--discovery\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Discovery</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
|
11
|
+
"hidden": false
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"name": "alpha",
|
15
|
+
"options": {
|
16
|
+
"phase": "alpha",
|
17
|
+
"message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
|
18
|
+
},
|
19
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--alpha\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Alpha</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
|
20
|
+
"hidden": false
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "beta",
|
24
|
+
"options": {
|
25
|
+
"phase": "beta",
|
26
|
+
"message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
|
27
|
+
},
|
28
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--beta\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Beta</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
|
29
|
+
"hidden": false
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"name": "live",
|
33
|
+
"options": {
|
34
|
+
"phase": "live",
|
35
|
+
"message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
|
36
|
+
},
|
37
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--live\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
|
38
|
+
"hidden": false
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "capital letters",
|
42
|
+
"options": {
|
43
|
+
"phase": "BETA",
|
44
|
+
"message": "Message"
|
45
|
+
},
|
46
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--beta\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Beta</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
|
47
|
+
"hidden": false
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"name": "unknown phase",
|
51
|
+
"options": {
|
52
|
+
"phase": "unknown",
|
53
|
+
"message": "Message"
|
54
|
+
},
|
55
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--unknown\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Unknown</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
|
56
|
+
"hidden": false
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"name": "with classes",
|
60
|
+
"options": {
|
61
|
+
"phase": "live",
|
62
|
+
"message": "Message",
|
63
|
+
"classes": "tna-phase-banner--fixture"
|
64
|
+
},
|
65
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--fixture tna-phase-banner--live\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
|
66
|
+
"hidden": false
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "with attributes",
|
70
|
+
"options": {
|
71
|
+
"phase": "live",
|
72
|
+
"message": "Message",
|
73
|
+
"attributes": {
|
74
|
+
"data-fixturetest": "pass"
|
75
|
+
}
|
76
|
+
},
|
77
|
+
"html": "<div class=\"tna-phase-banner tna-phase-banner--live\" data-fixturetest=\"pass\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
|
78
|
+
"hidden": false
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "phase",
|
4
|
+
"type": "string",
|
5
|
+
"required": true,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "message",
|
10
|
+
"type": "string",
|
11
|
+
"required": true,
|
12
|
+
"description": ""
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "classes",
|
16
|
+
"type": "string",
|
17
|
+
"required": false,
|
18
|
+
"description": "Classes to add to the phase banner."
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "attributes",
|
22
|
+
"type": "object",
|
23
|
+
"required": false,
|
24
|
+
"description": "HTML attributes (for example data attributes) to add to the phase banner."
|
25
|
+
}
|
26
|
+
]
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import PhaseBanner from "./template.njk";
|
2
|
+
import macroOptions from "./macro-options.json";
|
3
|
+
|
4
|
+
const argTypes = {
|
5
|
+
phase: {
|
6
|
+
control: "radio",
|
7
|
+
options: ["discovery", "alpha", "beta", "live"],
|
8
|
+
},
|
9
|
+
message: { control: "text" },
|
10
|
+
classes: { control: "text" },
|
11
|
+
attributes: { control: "object" },
|
12
|
+
};
|
13
|
+
|
14
|
+
Object.keys(argTypes).forEach((argType) => {
|
15
|
+
argTypes[argType].description = macroOptions.find(
|
16
|
+
(option) => option.name === argType,
|
17
|
+
)?.description;
|
18
|
+
});
|
19
|
+
|
20
|
+
export default {
|
21
|
+
title: "Work in progress/Components/Phase banner",
|
22
|
+
argTypes,
|
23
|
+
};
|
24
|
+
|
25
|
+
const Template = ({ phase, message, classes, attributes }) => {
|
26
|
+
return PhaseBanner({
|
27
|
+
params: {
|
28
|
+
phase,
|
29
|
+
message,
|
30
|
+
classes,
|
31
|
+
attributes,
|
32
|
+
},
|
33
|
+
});
|
34
|
+
};
|
35
|
+
|
36
|
+
export const Discovery = Template.bind({});
|
37
|
+
Discovery.args = {
|
38
|
+
phase: "discovery",
|
39
|
+
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
|
40
|
+
};
|
41
|
+
|
42
|
+
export const Alpha = Template.bind({});
|
43
|
+
Alpha.args = {
|
44
|
+
phase: "alpha",
|
45
|
+
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
|
46
|
+
};
|
47
|
+
|
48
|
+
export const Beta = Template.bind({});
|
49
|
+
Beta.args = {
|
50
|
+
phase: "beta",
|
51
|
+
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
|
52
|
+
};
|
53
|
+
|
54
|
+
export const Live = Template.bind({});
|
55
|
+
Live.args = {
|
56
|
+
phase: "live",
|
57
|
+
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
|
58
|
+
};
|
59
|
+
|
60
|
+
export const Unknown = Template.bind({});
|
61
|
+
Unknown.args = {
|
62
|
+
phase: "unknown",
|
63
|
+
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
|
64
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
|
+
{%- set containerClasses = containerClasses.concat('tna-phase-banner--' + params.phase | lower) -%}
|
3
|
+
<div class="tna-phase-banner {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
4
|
+
<div class="tna-container">
|
5
|
+
<div class="tna-column">
|
6
|
+
<span class="tna-phase-banner__phase">
|
7
|
+
{{ params.phase | capitalize }}
|
8
|
+
</span>
|
9
|
+
</div>
|
10
|
+
<div class="tna-column">
|
11
|
+
<p class="tna-phase-banner__message">
|
12
|
+
{{ params.message | safe }}
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
@use "../../utilities/global"; // To get %tna-invert
|
2
|
+
@use "../../tools/colour";
|
3
|
+
|
4
|
+
.tna-picture {
|
5
|
+
margin: 0 0 1rem;
|
6
|
+
padding: 0;
|
7
|
+
|
8
|
+
&__image-wrapper {
|
9
|
+
// padding: 1rem 0;
|
10
|
+
|
11
|
+
position: relative;
|
12
|
+
|
13
|
+
background-color: #f4f4f4;
|
14
|
+
}
|
15
|
+
|
16
|
+
&__image {
|
17
|
+
height: auto;
|
18
|
+
margin: 0 auto;
|
19
|
+
}
|
20
|
+
|
21
|
+
&__toggle-transcript {
|
22
|
+
position: absolute;
|
23
|
+
right: 1rem;
|
24
|
+
bottom: 1rem;
|
25
|
+
}
|
26
|
+
|
27
|
+
&__transcript {
|
28
|
+
// @include colour.invert;
|
29
|
+
@extend %tna-invert;
|
30
|
+
|
31
|
+
padding: 1rem 1.5rem 0.5rem;
|
32
|
+
|
33
|
+
.tna-template--clicked &:focus {
|
34
|
+
outline: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
.tna-tabs__list-item-link {
|
38
|
+
@include colour.colour-font("font-dark", true);
|
39
|
+
|
40
|
+
&::after {
|
41
|
+
@include colour.colour-background("keyline-dark", true);
|
42
|
+
}
|
43
|
+
|
44
|
+
.tna-template--js-enabled & {
|
45
|
+
@include colour.colour-font("font-light", true);
|
46
|
+
|
47
|
+
&--selected {
|
48
|
+
@include colour.colour-font("font-dark", true);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
&__caption {
|
55
|
+
padding: 1rem 0;
|
56
|
+
|
57
|
+
// position: relative;
|
58
|
+
|
59
|
+
text-align: center;
|
60
|
+
|
61
|
+
border-bottom: 1px solid;
|
62
|
+
@include colour.colour-border("keyline");
|
63
|
+
|
64
|
+
// &::after {
|
65
|
+
// height: 1px;
|
66
|
+
|
67
|
+
// position: absolute;
|
68
|
+
// right: 20%;
|
69
|
+
// bottom: 0;
|
70
|
+
// left: 20%;
|
71
|
+
|
72
|
+
// @include colour.colour-background("keyline");
|
73
|
+
|
74
|
+
// content: "";
|
75
|
+
// }
|
76
|
+
}
|
77
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "src",
|
4
|
+
"type": "string",
|
5
|
+
"required": true,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "alt",
|
10
|
+
"type": "string",
|
11
|
+
"required": true,
|
12
|
+
"description": ""
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "width",
|
16
|
+
"type": "number",
|
17
|
+
"required": true,
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "height",
|
22
|
+
"type": "number",
|
23
|
+
"required": true,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "sources",
|
28
|
+
"type": "array",
|
29
|
+
"required": false,
|
30
|
+
"description": "",
|
31
|
+
"params": [
|
32
|
+
{
|
33
|
+
"name": "media",
|
34
|
+
"type": "text",
|
35
|
+
"required": true,
|
36
|
+
"description": ""
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"name": "src",
|
40
|
+
"type": "text",
|
41
|
+
"required": true,
|
42
|
+
"description": ""
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "width",
|
46
|
+
"type": "number",
|
47
|
+
"required": false,
|
48
|
+
"description": ""
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "height",
|
52
|
+
"type": "number",
|
53
|
+
"required": false,
|
54
|
+
"description": ""
|
55
|
+
}
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"name": "caption",
|
60
|
+
"type": "string",
|
61
|
+
"required": false,
|
62
|
+
"description": ""
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "transcript",
|
66
|
+
"type": "string",
|
67
|
+
"required": false,
|
68
|
+
"description": ""
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "translation",
|
72
|
+
"type": "string",
|
73
|
+
"required": false,
|
74
|
+
"description": ""
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "classes",
|
78
|
+
"type": "string",
|
79
|
+
"required": false,
|
80
|
+
"description": "Classes to add to the phase banner."
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "attributes",
|
84
|
+
"type": "object",
|
85
|
+
"required": false,
|
86
|
+
"description": "HTML attributes (for example data attributes) to add to the phase banner."
|
87
|
+
}
|
88
|
+
]
|
@@ -0,0 +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})()));
|
2
|
+
//# sourceMappingURL=picture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"components/picture/picture.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,KAEzBD,EAAkB,YAAIA,EAAkB,aAAK,CAAC,EAAGA,EAAkB,YAAE,8BAAgCC,IACtG,CATD,CASGK,MAAM,I,yDCDT,QARe,WAAH,OACT,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAU,SAACC,GAAC,OAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAI,GAC5DI,SAAS,GAAG,GACf,C,GCLCC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAad,QAGrB,IAAIC,EAASU,EAAyBE,GAAY,CAGjDb,QAAS,CAAC,GAOX,OAHAgB,EAAoBH,GAAUZ,EAAQA,EAAOD,QAASY,GAG/CX,EAAOD,OACf,CCrBAY,EAAoBK,EAAI,CAACjB,EAASkB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEpB,EAASmB,IAC5EE,OAAOC,eAAetB,EAASmB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAK9B,IACH,oBAAX+B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAetB,EAAS+B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAetB,EAAS,aAAc,CAAEiC,OAAO,GAAO,E,muBCHvD,IAAMC,EAAO,WAClB,SAAAA,EAAYC,I,4FAASC,CAAA,KAAAF,GACnBG,KAAKF,QAAUA,EACfE,KAAKC,cACHH,GAAWA,EAAQI,cAAc,+BACnCF,KAAKG,YACHL,GAAWA,EAAQI,cAAc,4BACnCF,KAAKI,kBAAmB,CAC1B,C,QA6CC,O,EA7CAP,G,EAAA,EAAAf,IAAA,OAAAc,MAED,WAAO,IAAAS,EAAA,KACL,GAAKL,KAAKF,SAAYE,KAAKC,eAAkBD,KAAKG,YAAlD,CAIA,IAAMG,EAAW,eAAHC,QAAkBC,EAAAA,EAAAA,MAEhCR,KAAKS,kBAAoBC,SAASC,cAAc,UAChDX,KAAKS,kBAAkBG,UAAUC,IAC/B,iCACA,cAEFb,KAAKS,kBAAkBK,aAAa,gBAAiBR,GACrDN,KAAKS,kBAAkBK,aAAa,iBAAiB,GACrDd,KAAKS,kBAAkBM,UAAY,kBACnCf,KAAKS,kBAAkBO,iBAAiB,SAAS,kBAC/CX,EAAKY,wBAAwB,IAE/BjB,KAAKC,cAAciB,YAAYlB,KAAKS,mBAEpCT,KAAKG,YAAYW,aAAa,KAAMR,GACpCN,KAAKG,YAAYW,aAAa,UAAU,EAlBxC,CAoBF,GAAC,CAAAhC,IAAA,yBAAAc,MAED,WACE,IAAMuB,EACJ,yCACFnB,KAAKI,kBAAoBJ,KAAKI,iBAC1BJ,KAAKI,kBACPJ,KAAKS,kBAAkBG,UAAUC,IAAIM,GACrCnB,KAAKS,kBAAkBK,aAAa,iBAAiB,GACrDd,KAAKS,kBAAkBM,UAAY,mBACnCf,KAAKG,YAAYiB,gBAAgB,YAIjCpB,KAAKS,kBAAkBG,UAAUS,OAAOF,GACxCnB,KAAKS,kBAAkBK,aAAa,iBAAiB,GACrDd,KAAKS,kBAAkBM,UAAY,kBACnCf,KAAKG,YAAYW,aAAa,UAAU,GAG5C,M,oEAACjB,CAAA,CArDiB,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs","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 );\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":""}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import uuidv4 from "../../lib/uuid.mjs";
|
2
|
+
|
3
|
+
export class Picture {
|
4
|
+
constructor($module) {
|
5
|
+
this.$module = $module;
|
6
|
+
this.$imageWrapper =
|
7
|
+
$module && $module.querySelector(".tna-picture__image-wrapper");
|
8
|
+
this.$transcript =
|
9
|
+
$module && $module.querySelector(".tna-picture__transcript");
|
10
|
+
this.transcriptOpened = false;
|
11
|
+
}
|
12
|
+
|
13
|
+
init() {
|
14
|
+
if (!this.$module || !this.$imageWrapper || !this.$transcript) {
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
|
18
|
+
const uniqueId = `tna-picture-${uuidv4()}`;
|
19
|
+
|
20
|
+
this.$transcriptToggle = document.createElement("button");
|
21
|
+
this.$transcriptToggle.classList.add(
|
22
|
+
"tna-picture__toggle-transcript",
|
23
|
+
"tna-button",
|
24
|
+
);
|
25
|
+
this.$transcriptToggle.setAttribute("aria-controls", uniqueId);
|
26
|
+
this.$transcriptToggle.setAttribute("aria-expanded", false);
|
27
|
+
this.$transcriptToggle.innerText = "Open transcript";
|
28
|
+
this.$transcriptToggle.addEventListener("click", () =>
|
29
|
+
this.handleToggleTranscript(),
|
30
|
+
);
|
31
|
+
this.$imageWrapper.appendChild(this.$transcriptToggle);
|
32
|
+
|
33
|
+
this.$transcript.setAttribute("id", uniqueId);
|
34
|
+
this.$transcript.setAttribute("hidden", true);
|
35
|
+
// this.$transcript.setAttribute("tabindex", "-1");
|
36
|
+
}
|
37
|
+
|
38
|
+
handleToggleTranscript() {
|
39
|
+
const transcriptToggleOpenedClass =
|
40
|
+
"tna-picture__toggle-transcript--opened";
|
41
|
+
this.transcriptOpened = !this.transcriptOpened;
|
42
|
+
if (this.transcriptOpened) {
|
43
|
+
this.$transcriptToggle.classList.add(transcriptToggleOpenedClass);
|
44
|
+
this.$transcriptToggle.setAttribute("aria-expanded", true);
|
45
|
+
this.$transcriptToggle.innerText = "Close transcript";
|
46
|
+
this.$transcript.removeAttribute("hidden");
|
47
|
+
// this.$transcript.setAttribute("tabindex", "0");
|
48
|
+
// this.$transcript.focus();
|
49
|
+
} else {
|
50
|
+
this.$transcriptToggle.classList.remove(transcriptToggleOpenedClass);
|
51
|
+
this.$transcriptToggle.setAttribute("aria-expanded", false);
|
52
|
+
this.$transcriptToggle.innerText = "Open transcript";
|
53
|
+
this.$transcript.setAttribute("hidden", true);
|
54
|
+
// this.$transcript.setAttribute("tabindex", "-1");
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import Picture from "./template.njk";
|
2
|
+
import macroOptions from "./macro-options.json";
|
3
|
+
|
4
|
+
const argTypes = {
|
5
|
+
src: { control: "text" },
|
6
|
+
width: { control: "number" },
|
7
|
+
height: { control: "number" },
|
8
|
+
sources: { control: "object" },
|
9
|
+
caption: { control: "text" },
|
10
|
+
transcript: { control: "text" },
|
11
|
+
translation: { control: "text" },
|
12
|
+
classes: { control: "text" },
|
13
|
+
attributes: { control: "object" },
|
14
|
+
};
|
15
|
+
|
16
|
+
Object.keys(argTypes).forEach((argType) => {
|
17
|
+
argTypes[argType].description = macroOptions.find(
|
18
|
+
(option) => option.name === argType,
|
19
|
+
)?.description;
|
20
|
+
});
|
21
|
+
|
22
|
+
export default {
|
23
|
+
title: "Work in progress/Components/Picture",
|
24
|
+
argTypes,
|
25
|
+
};
|
26
|
+
|
27
|
+
const Template = ({
|
28
|
+
src,
|
29
|
+
width,
|
30
|
+
height,
|
31
|
+
sources,
|
32
|
+
caption,
|
33
|
+
transcript,
|
34
|
+
translation,
|
35
|
+
classes,
|
36
|
+
attributes,
|
37
|
+
}) => {
|
38
|
+
return Picture({
|
39
|
+
params: {
|
40
|
+
src,
|
41
|
+
width,
|
42
|
+
height,
|
43
|
+
sources,
|
44
|
+
caption,
|
45
|
+
transcript,
|
46
|
+
translation,
|
47
|
+
classes,
|
48
|
+
attributes,
|
49
|
+
},
|
50
|
+
});
|
51
|
+
};
|
52
|
+
|
53
|
+
export const Standard = Template.bind({});
|
54
|
+
Standard.args = {
|
55
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
56
|
+
alt: "The National Archives office",
|
57
|
+
width: 1996,
|
58
|
+
height: 1331,
|
59
|
+
caption: "<p>This is a pretty image</p>",
|
60
|
+
transcript: "<p>Lorem ipsum transcript</p>",
|
61
|
+
translation: "<p>Lorem ipsum translation</p>",
|
62
|
+
classes: "tna-picture--demo",
|
63
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{% from "nationalarchives/components/tabs/macro.njk" import tnaTabs %}
|
2
|
+
|
3
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
4
|
+
<figure class="tna-picture {{ containerClasses | join(' ') }}" data-module="tna-picture" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
5
|
+
<div class="tna-picture__image-wrapper">
|
6
|
+
<picture>
|
7
|
+
{%- for source in params.sources -%}
|
8
|
+
<source class="tna-picture__image" media="{{ source.media }}" srcset="{{ source.src }}" width="{{ source.width }}" height="{{ source.height }}">
|
9
|
+
{%- endfor -%}
|
10
|
+
<img class="tna-picture__image" width="{{ params.width }}" height="{{ params.height }}" src="{{ params.src }}" alt="{{ params.alt }}">
|
11
|
+
</picture>
|
12
|
+
</div>
|
13
|
+
{%- if params.transcript or params.translation -%}
|
14
|
+
<div class="tna-picture__transcript">
|
15
|
+
{%- if params.transcript and params.translation -%}
|
16
|
+
{{ tnaTabs({
|
17
|
+
items: [
|
18
|
+
{
|
19
|
+
id: "test1",
|
20
|
+
title: "Transcript",
|
21
|
+
body: params.transcript
|
22
|
+
},
|
23
|
+
{
|
24
|
+
id: "test2",
|
25
|
+
title: "English translation",
|
26
|
+
body: params.translation
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}) }}
|
30
|
+
{%- elseif params.transcript -%}
|
31
|
+
{{ params.transcript | safe }}
|
32
|
+
{%- else -%}
|
33
|
+
{{ params.translation | safe }}
|
34
|
+
{%- endif -%}
|
35
|
+
</div>
|
36
|
+
{%- endif -%}
|
37
|
+
{%- if params.caption -%}
|
38
|
+
<figcaption class="tna-picture__caption">
|
39
|
+
{{ params.caption | safe }}
|
40
|
+
</figcaption>
|
41
|
+
{%- endif -%}
|
42
|
+
</figure>
|