@nationalarchives/frontend 0.1.20-prerelease → 0.1.21-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 +1 -1
- package/govuk-prototype-kit.config.json +6 -1
- package/nationalarchives/_prototype-kit.scss +16 -0
- package/nationalarchives/all.css +3 -3
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +17 -10
- package/nationalarchives/all.scss +1 -5
- package/nationalarchives/assets/images/favicon.ico +0 -0
- package/nationalarchives/assets/images/mask-icon.svg +17 -5
- package/nationalarchives/assets/images/mstile-150x150.png +0 -0
- package/nationalarchives/components/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +10 -0
- package/nationalarchives/components/button/button.css +1 -13
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +23 -6
- package/nationalarchives/components/card/card.css +1 -13
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +51 -6
- package/nationalarchives/components/card/card.stories.js +74 -35
- package/nationalarchives/components/card/fixtures.json +39 -15
- package/nationalarchives/components/card/macro-options.json +20 -0
- package/nationalarchives/components/card/template.njk +38 -26
- package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -13
- package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.mjs +15 -7
- package/nationalarchives/components/cookie-banner/cookie-banner.scss +9 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +23 -10
- package/nationalarchives/components/cookie-banner/macro-options.json +1 -1
- package/nationalarchives/components/cookie-banner/template.njk +4 -4
- package/nationalarchives/components/filters/filters.css +1 -1
- package/nationalarchives/components/filters/filters.css.map +1 -1
- package/nationalarchives/components/filters/filters.scss +1 -1
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.css +1 -13
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.scss +2 -8
- package/nationalarchives/components/footer/template.njk +8 -7
- package/nationalarchives/components/gallery/gallery.css +1 -13
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/grid/grid.css +1 -1
- package/nationalarchives/components/grid/grid.css.map +1 -1
- package/nationalarchives/components/grid/grid.scss +15 -11
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.scss +10 -24
- package/nationalarchives/components/hero/fixtures.json +85 -6
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +177 -63
- package/nationalarchives/components/hero/hero.stories.js +74 -23
- package/nationalarchives/components/hero/macro-options.json +28 -36
- package/nationalarchives/components/hero/template.njk +26 -24
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/index-grid/template.njk +1 -1
- package/nationalarchives/components/message/message.css +1 -1
- package/nationalarchives/components/message/message.css.map +1 -1
- package/nationalarchives/components/pagination/_index.scss +1 -0
- package/nationalarchives/components/pagination/fixtures.json +4 -0
- package/nationalarchives/components/pagination/macro-options.json +116 -0
- package/nationalarchives/components/pagination/macro.njk +3 -0
- package/nationalarchives/components/pagination/pagination.css +1 -0
- package/nationalarchives/components/pagination/pagination.css.map +1 -0
- package/nationalarchives/components/pagination/pagination.scss +79 -0
- package/nationalarchives/components/pagination/pagination.stories.js +73 -0
- package/nationalarchives/components/pagination/template.njk +38 -0
- package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/picture.css +1 -13
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/picture/picture.stories.js +2 -2
- package/nationalarchives/components/profile/profile.css +1 -1
- package/nationalarchives/components/profile/profile.css.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
- package/nationalarchives/components/skip-link/fixtures.json +1 -1
- package/nationalarchives/components/skip-link/skip-link.css +1 -1
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
- package/nationalarchives/components/skip-link/skip-link.js +2 -0
- package/nationalarchives/components/skip-link/skip-link.js.map +1 -0
- package/nationalarchives/components/skip-link/skip-link.mjs +40 -0
- package/nationalarchives/components/skip-link/skip-link.scss +18 -16
- package/nationalarchives/components/skip-link/skip-link.stories.js +48 -6
- package/nationalarchives/components/skip-link/template.njk +1 -1
- package/nationalarchives/components/tabs/tabs.css +1 -1
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.js +1 -1
- package/nationalarchives/components/tabs/tabs.js.map +1 -1
- package/nationalarchives/components/tabs/tabs.mjs +6 -2
- package/nationalarchives/components/tabs/tabs.scss +16 -1
- package/nationalarchives/lib/_font-awesome.scss +3 -2
- package/nationalarchives/lib/cookies.mjs +122 -50
- package/nationalarchives/stories/development/contributing.mdx +0 -10
- package/nationalarchives/stories/development/cookies.mdx +82 -0
- package/nationalarchives/stories/development/structure.mdx +88 -0
- package/nationalarchives/stories/development/using/compiled.mdx +9 -0
- package/nationalarchives/stories/development/using/hosted.mdx +53 -0
- package/nationalarchives/stories/development/using/npm.mdx +59 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +284 -29
- package/nationalarchives/stories/utilities/typography/headings.stories.js +4 -1
- package/nationalarchives/stories/utilities/typography/lists.stories.js +93 -0
- package/nationalarchives/stories/utilities/typography/typography.mdx +11 -1
- package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
- package/nationalarchives/templates/homepage.njk +11 -58
- package/nationalarchives/templates/layouts/_generic.njk +33 -14
- package/nationalarchives/templates/layouts/_prototype-kit.njk +11 -1
- package/nationalarchives/templates/search-results.njk +10 -14
- package/nationalarchives/templates/topics.njk +18 -22
- package/nationalarchives/tools/_colour.scss +42 -18
- package/nationalarchives/tools/_media.scss +6 -0
- package/nationalarchives/tools/_typography.scss +4 -2
- package/nationalarchives/utilities/_a11y.scss +15 -0
- package/nationalarchives/utilities/_debug.scss +1 -1
- package/nationalarchives/utilities/_global.scss +23 -25
- package/nationalarchives/utilities/_typography.scss +204 -27
- package/nationalarchives/variables/_assets.scss +2 -1
- package/nationalarchives/variables/_colour.scss +94 -73
- package/nationalarchives/variables/_features.scss +1 -0
- package/nationalarchives/variables/_grid.scss +5 -5
- package/nationalarchives/variables/_index.scss +1 -0
- package/nationalarchives/variables/_media.scss +29 -29
- package/nationalarchives/variables/_typography.scss +15 -12
- package/package.json +1 -1
- package/nationalarchives/_features.scss +0 -1
- package/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg +0 -51
- package/nationalarchives/assets/images/tna-horizontal-logo.svg +0 -51
- package/nationalarchives/stories/development/relationships.mdx +0 -57
- package/nationalarchives/stories/development/using.mdx +0 -75
@@ -1,137 +1,245 @@
|
|
1
1
|
@use "../../tools/colour";
|
2
2
|
@use "../../tools/media";
|
3
|
+
@use "../../tools/typography";
|
3
4
|
@use "../../utilities";
|
4
5
|
@use "../grid";
|
5
6
|
|
6
7
|
.tna-hero {
|
7
|
-
|
8
|
-
// margin-bottom: 2rem;
|
9
|
-
padding-top: 5rem;
|
10
|
-
padding-bottom: 3rem;
|
8
|
+
@include colour.invert-on-mobile;
|
11
9
|
|
12
|
-
|
13
|
-
|
10
|
+
&__figure {
|
11
|
+
min-height: min(35vw, 480px);
|
12
|
+
margin: 0;
|
13
|
+
padding-top: 8rem;
|
14
|
+
padding-bottom: 4rem;
|
14
15
|
|
15
|
-
|
16
|
+
display: flex;
|
17
|
+
align-items: flex-end;
|
16
18
|
|
17
|
-
|
19
|
+
position: relative;
|
20
|
+
}
|
18
21
|
|
19
|
-
&
|
22
|
+
&__caption {
|
20
23
|
width: 100%;
|
21
|
-
height: 100%;
|
22
24
|
|
23
25
|
position: absolute;
|
24
|
-
|
25
|
-
|
26
|
+
right: 0;
|
27
|
+
bottom: 0;
|
28
|
+
z-index: 5;
|
26
29
|
|
27
|
-
|
30
|
+
overflow: visible;
|
28
31
|
}
|
29
32
|
|
30
|
-
|
33
|
+
&__details {
|
31
34
|
width: 100%;
|
32
|
-
height: 100%;
|
33
35
|
|
34
|
-
|
36
|
+
overflow: visible;
|
35
37
|
}
|
36
38
|
|
37
|
-
&
|
38
|
-
|
39
|
-
|
40
|
-
bottom: 1.25rem;
|
41
|
-
z-index: 3;
|
42
|
-
|
43
|
-
@include colour.colour-font("font-base");
|
44
|
-
}
|
39
|
+
&__details-summary {
|
40
|
+
width: 1.5rem;
|
41
|
+
height: 1.5rem;
|
45
42
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
position: relative;
|
43
|
+
position: absolute;
|
44
|
+
right: 0.5rem;
|
45
|
+
bottom: 0.5rem;
|
51
46
|
z-index: 2;
|
52
47
|
|
53
48
|
font-size: 0;
|
54
49
|
text-align: center;
|
55
|
-
line-height:
|
50
|
+
line-height: 1.5rem;
|
56
51
|
list-style: none;
|
57
52
|
|
58
|
-
|
53
|
+
@include colour.accent;
|
59
54
|
|
60
|
-
border
|
55
|
+
@include colour.colour-border("background", 0.25rem);
|
56
|
+
border-radius: 100%;
|
61
57
|
|
62
58
|
cursor: pointer;
|
59
|
+
|
60
|
+
&:hover {
|
61
|
+
@include colour.colour-font("background");
|
62
|
+
|
63
|
+
@include colour.colour-background("font-base");
|
64
|
+
}
|
63
65
|
}
|
64
66
|
|
65
|
-
&
|
67
|
+
&__details-summary-icon {
|
66
68
|
font-size: 1.25rem;
|
67
69
|
font-style: normal;
|
68
70
|
font-weight: 700;
|
69
71
|
text-transform: lowercase;
|
70
72
|
}
|
71
73
|
|
72
|
-
&
|
73
|
-
width:
|
74
|
-
max-width:
|
75
|
-
padding: 0.5rem 1rem;
|
74
|
+
&__information {
|
75
|
+
width: 50rem;
|
76
|
+
max-width: 50vw;
|
77
|
+
padding: 0.5rem 3.25rem 0.5rem 1rem;
|
76
78
|
|
77
79
|
position: absolute;
|
78
80
|
right: 0;
|
79
|
-
bottom:
|
81
|
+
bottom: 0;
|
82
|
+
z-index: 1;
|
83
|
+
|
84
|
+
@include colour.invert;
|
85
|
+
|
86
|
+
// @include typography.relative-font-size(16);
|
87
|
+
}
|
88
|
+
|
89
|
+
&__image {
|
90
|
+
width: 100%;
|
91
|
+
height: 100%;
|
92
|
+
|
93
|
+
position: absolute;
|
94
|
+
inset: 0;
|
80
95
|
z-index: 1;
|
81
96
|
|
82
|
-
|
97
|
+
object-fit: cover;
|
98
|
+
}
|
99
|
+
|
100
|
+
&__details[open] &__details-summary {
|
101
|
+
@include colour.invert;
|
102
|
+
|
103
|
+
&::before,
|
104
|
+
&::after {
|
105
|
+
width: 1.5rem;
|
106
|
+
height: 0.125rem;
|
107
|
+
|
108
|
+
display: block;
|
109
|
+
|
110
|
+
position: absolute;
|
111
|
+
top: 50%;
|
112
|
+
left: 50%;
|
113
|
+
|
114
|
+
@include colour.colour-background("font-dark");
|
115
|
+
|
116
|
+
content: "";
|
117
|
+
}
|
118
|
+
|
119
|
+
&::before {
|
120
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
121
|
+
}
|
122
|
+
|
123
|
+
&::after {
|
124
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
125
|
+
}
|
126
|
+
|
127
|
+
&:hover {
|
128
|
+
&::before,
|
129
|
+
&::after {
|
130
|
+
height: 0.25rem;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
&-icon {
|
135
|
+
font-size: 0;
|
136
|
+
}
|
83
137
|
}
|
84
138
|
|
85
139
|
&__inner {
|
86
140
|
position: relative;
|
87
|
-
z-index:
|
141
|
+
z-index: 4;
|
88
142
|
}
|
89
143
|
|
90
144
|
&__content {
|
91
145
|
}
|
92
146
|
|
93
147
|
&__content-inner {
|
94
|
-
padding:
|
148
|
+
padding: 1.5rem;
|
95
149
|
|
96
150
|
@include colour.colour-background("page-background");
|
97
151
|
}
|
98
152
|
|
99
153
|
&__heading {
|
100
|
-
margin-bottom: 0;
|
101
154
|
}
|
102
155
|
|
103
156
|
&__body {
|
104
|
-
|
157
|
+
}
|
158
|
+
|
159
|
+
&--tint .tna-hero__figure {
|
160
|
+
// @include colour.colour-border("keyline-dark", 1px, solid, top);
|
161
|
+
// @include colour.colour-border("keyline-dark", 1px, solid, bottom);
|
162
|
+
|
163
|
+
&::before,
|
164
|
+
&::after {
|
165
|
+
position: absolute;
|
166
|
+
inset: 0;
|
167
|
+
|
168
|
+
content: "";
|
169
|
+
}
|
170
|
+
|
171
|
+
&::before {
|
172
|
+
z-index: 2;
|
173
|
+
|
174
|
+
background-color: colour.brand-colour("maroon");
|
175
|
+
@include colour.colour-background("accent-background");
|
176
|
+
|
177
|
+
mix-blend-mode: screen;
|
178
|
+
}
|
179
|
+
|
180
|
+
&::after {
|
181
|
+
z-index: 3;
|
182
|
+
|
183
|
+
background-color: colour.brand-colour("cream");
|
184
|
+
|
185
|
+
mix-blend-mode: multiply;
|
186
|
+
}
|
187
|
+
|
188
|
+
.tna-hero__image {
|
189
|
+
filter: grayscale(1) contrast(1.75) brightness(1.2);
|
190
|
+
}
|
191
|
+
|
192
|
+
.tna-hero__content-inner {
|
193
|
+
// @include colour.colour-border("keyline-dark", 1px);
|
194
|
+
|
195
|
+
@include media.on-mobile {
|
196
|
+
// border: none;
|
197
|
+
}
|
198
|
+
}
|
105
199
|
}
|
106
200
|
|
107
201
|
@include media.on-mobile {
|
108
|
-
|
202
|
+
&__figure {
|
203
|
+
padding: 0;
|
109
204
|
|
110
|
-
|
205
|
+
flex-direction: column;
|
111
206
|
|
112
|
-
|
113
|
-
|
207
|
+
background-color: inherit;
|
208
|
+
}
|
114
209
|
|
115
|
-
|
210
|
+
&__caption {
|
211
|
+
position: relative;
|
212
|
+
order: 2;
|
213
|
+
}
|
214
|
+
|
215
|
+
&__details {
|
116
216
|
}
|
117
217
|
|
118
|
-
&
|
119
|
-
bottom: auto;
|
120
|
-
top: 1.25rem;
|
218
|
+
&__details-summary {
|
121
219
|
}
|
122
220
|
|
123
|
-
&
|
221
|
+
&__details-summary-icon {
|
124
222
|
}
|
125
223
|
|
126
|
-
&
|
224
|
+
&__information {
|
225
|
+
width: auto;
|
226
|
+
max-width: none;
|
227
|
+
|
228
|
+
left: 0;
|
229
|
+
|
230
|
+
@include colour.colour-border("keyline", 1px, solid, bottom);
|
127
231
|
}
|
128
232
|
|
129
|
-
&__image
|
130
|
-
|
131
|
-
|
233
|
+
&__image {
|
234
|
+
position: static;
|
235
|
+
|
236
|
+
order: 1;
|
132
237
|
}
|
133
238
|
|
134
239
|
&__inner {
|
240
|
+
order: 3;
|
241
|
+
|
242
|
+
background-color: inherit;
|
135
243
|
}
|
136
244
|
|
137
245
|
&__content {
|
@@ -151,17 +259,23 @@
|
|
151
259
|
}
|
152
260
|
}
|
153
261
|
|
154
|
-
@include media.on-tiny {
|
155
|
-
&__image {
|
156
|
-
height: 240px;
|
157
|
-
}
|
158
|
-
}
|
159
|
-
|
160
262
|
@include colour.on-high-contrast {
|
263
|
+
&__information,
|
161
264
|
&__content-inner {
|
162
265
|
@include colour.colour-border("keyline-dark", 1px);
|
266
|
+
}
|
163
267
|
|
164
|
-
|
268
|
+
@include media.on-mobile {
|
269
|
+
&__information {
|
270
|
+
// border-bottom: 0
|
271
|
+
}
|
272
|
+
|
273
|
+
&__inner {
|
274
|
+
@include colour.colour-border("keyline-dark", 1px);
|
275
|
+
border-top: 0;
|
276
|
+
}
|
277
|
+
|
278
|
+
&__content-inner {
|
165
279
|
border: none;
|
166
280
|
}
|
167
281
|
}
|
@@ -2,12 +2,20 @@ import Hero from "./template.njk";
|
|
2
2
|
import macroOptions from "./macro-options.json";
|
3
3
|
import { expect } from "@storybook/jest";
|
4
4
|
import { within, userEvent } from "@storybook/testing-library";
|
5
|
+
import { customViewports } from "../../../../.storybook/viewports";
|
5
6
|
|
6
7
|
const argTypes = {
|
7
8
|
heading: { control: "text" },
|
8
9
|
body: { control: "text" },
|
9
10
|
text: { control: "text" },
|
10
|
-
|
11
|
+
|
12
|
+
imageSrc: { control: { type: "file", accept: ".jpg" } },
|
13
|
+
imageAlt: { control: "text" },
|
14
|
+
imageWidth: { control: { type: "number", min: 1 } },
|
15
|
+
imageHeight: { control: { type: "number", min: 1 } },
|
16
|
+
|
17
|
+
imageCaption: { control: "text" },
|
18
|
+
|
11
19
|
classes: { control: "text" },
|
12
20
|
attributes: { control: "object" },
|
13
21
|
};
|
@@ -23,13 +31,28 @@ export default {
|
|
23
31
|
argTypes,
|
24
32
|
};
|
25
33
|
|
26
|
-
const Template = ({
|
34
|
+
const Template = ({
|
35
|
+
heading,
|
36
|
+
body,
|
37
|
+
text,
|
38
|
+
imageSrc,
|
39
|
+
imageAlt,
|
40
|
+
imageWidth,
|
41
|
+
imageHeight,
|
42
|
+
imageCaption,
|
43
|
+
classes,
|
44
|
+
attributes,
|
45
|
+
}) =>
|
27
46
|
Hero({
|
28
47
|
params: {
|
29
48
|
heading,
|
30
49
|
body,
|
31
50
|
text,
|
32
|
-
|
51
|
+
imageSrc,
|
52
|
+
imageAlt,
|
53
|
+
imageWidth,
|
54
|
+
imageHeight,
|
55
|
+
imageCaption,
|
33
56
|
classes,
|
34
57
|
attributes,
|
35
58
|
},
|
@@ -38,14 +61,13 @@ const Template = ({ heading, body, text, image, classes, attributes }) =>
|
|
38
61
|
export const Standard = Template.bind({});
|
39
62
|
Standard.args = {
|
40
63
|
heading: "Title",
|
41
|
-
body: "<p>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
},
|
64
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
|
65
|
+
imageSrc:
|
66
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
67
|
+
imageAlt: "The National Archives office",
|
68
|
+
imageWidth: 499,
|
69
|
+
imageHeight: 333,
|
70
|
+
imageCaption: "An interesting photo by a famous photographer ©2023",
|
49
71
|
classes: "tna-hero--demo",
|
50
72
|
};
|
51
73
|
|
@@ -53,12 +75,10 @@ Standard.play = async ({ args, canvasElement, step }) => {
|
|
53
75
|
await new Promise((r) => setTimeout(r, 100));
|
54
76
|
|
55
77
|
const canvas = within(canvasElement);
|
56
|
-
const image = canvas.getByAltText(args.
|
78
|
+
const image = canvas.getByAltText(args.imageAlt);
|
57
79
|
const title = canvas.getByText(args.heading);
|
58
|
-
const summary = canvasElement.querySelector(
|
59
|
-
|
60
|
-
);
|
61
|
-
const information = canvas.getByText(args.image.information);
|
80
|
+
const summary = canvasElement.querySelector(".tna-hero__details-summary");
|
81
|
+
const information = canvas.getByText(args.imageCaption);
|
62
82
|
|
63
83
|
await step("Initial load", async () => {
|
64
84
|
await expect(image).toBeVisible();
|
@@ -78,14 +98,45 @@ Standard.play = async ({ args, canvasElement, step }) => {
|
|
78
98
|
});
|
79
99
|
};
|
80
100
|
|
81
|
-
export const
|
82
|
-
|
101
|
+
export const HeadingOnly = Template.bind({});
|
102
|
+
HeadingOnly.args = {
|
83
103
|
heading: "Title",
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
104
|
+
imageSrc:
|
105
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
106
|
+
imageAlt: "The National Archives office",
|
107
|
+
imageWidth: 499,
|
108
|
+
imageHeight: 333,
|
109
|
+
classes: "tna-hero--demo",
|
110
|
+
};
|
111
|
+
|
112
|
+
export const CaptionWithNoHeading = Template.bind({});
|
113
|
+
CaptionWithNoHeading.args = {
|
114
|
+
imageSrc:
|
115
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
116
|
+
imageAlt: "The National Archives office",
|
117
|
+
imageWidth: 499,
|
118
|
+
imageHeight: 333,
|
119
|
+
imageCaption: "An interesting photo by a famous photographer ©2023",
|
120
|
+
classes: "tna-hero--demo",
|
121
|
+
};
|
122
|
+
|
123
|
+
export const Mobile = Template.bind({});
|
124
|
+
Mobile.parameters = {
|
125
|
+
viewport: {
|
126
|
+
defaultViewport: "small",
|
89
127
|
},
|
128
|
+
chromatic: {
|
129
|
+
viewports: [customViewports["small"].styles.width.replace(/px$/, "")],
|
130
|
+
},
|
131
|
+
};
|
132
|
+
Mobile.args = {
|
133
|
+
heading: "Title",
|
134
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
|
135
|
+
imageSrc:
|
136
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
137
|
+
imageAlt: "The National Archives office",
|
138
|
+
imageWidth: 499,
|
139
|
+
imageHeight: 333,
|
140
|
+
imageCaption: "An interesting photo by a famous photographer ©2023",
|
90
141
|
classes: "tna-hero--demo",
|
91
142
|
};
|
@@ -2,7 +2,7 @@
|
|
2
2
|
{
|
3
3
|
"name": "heading",
|
4
4
|
"type": "string",
|
5
|
-
"required":
|
5
|
+
"required": false,
|
6
6
|
"description": ""
|
7
7
|
},
|
8
8
|
{
|
@@ -18,42 +18,34 @@
|
|
18
18
|
"description": ""
|
19
19
|
},
|
20
20
|
{
|
21
|
-
"name": "
|
22
|
-
"type": "
|
21
|
+
"name": "imageSrc",
|
22
|
+
"type": "string",
|
23
|
+
"required": true,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "imageAlt",
|
28
|
+
"type": "string",
|
23
29
|
"required": true,
|
24
|
-
"description": ""
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
},
|
44
|
-
{
|
45
|
-
"name": "height",
|
46
|
-
"type": "number",
|
47
|
-
"required": true,
|
48
|
-
"description": ""
|
49
|
-
},
|
50
|
-
{
|
51
|
-
"name": "information",
|
52
|
-
"type": "string",
|
53
|
-
"required": false,
|
54
|
-
"description": ""
|
55
|
-
}
|
56
|
-
]
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "imageWidth",
|
34
|
+
"type": "number",
|
35
|
+
"required": true,
|
36
|
+
"description": ""
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"name": "imageHeight",
|
40
|
+
"type": "number",
|
41
|
+
"required": true,
|
42
|
+
"description": ""
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "imageCaption",
|
46
|
+
"type": "string",
|
47
|
+
"required": false,
|
48
|
+
"description": ""
|
57
49
|
},
|
58
50
|
{
|
59
51
|
"name": "classes",
|
@@ -1,34 +1,36 @@
|
|
1
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
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
2
|
+
<{{ 'header' if params.heading else 'div' }} class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
|
+
<figure class="tna-hero__figure">
|
4
|
+
{%- if params.imageCaption -%}
|
5
|
+
<figcaption class="tna-hero__caption">
|
6
|
+
<details class="tna-hero__details">
|
7
|
+
<summary class="tna-hero__details-summary">
|
8
|
+
<span class="tna-hero__details-summary-icon">I</span>mage caption
|
9
|
+
</summary>
|
10
|
+
<div class="tna-hero__information">
|
11
|
+
<p>{{ params.imageCaption }}</p>
|
12
|
+
</div>
|
13
|
+
</details>
|
14
|
+
</figcaption>
|
15
|
+
{%- endif -%}
|
16
|
+
<img src="{{ params.imageSrc }}" alt="{{ params.imageAlt }}" class="tna-hero__image" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
|
17
|
+
{%- if params.heading -%}
|
18
|
+
<div class="tna-container tna-hero__inner">
|
19
|
+
<div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny tna-hero__content">
|
20
|
+
<div class="tna-hero__content-inner">
|
17
21
|
{%- if params.heading -%}
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
<h1 class="tna-heading tna-heading--xl tna-hero__heading">
|
23
|
+
{{ params.heading }}
|
24
|
+
</h1>
|
21
25
|
{%- endif -%}
|
22
26
|
{%- if params.text -%}
|
23
|
-
<div class="tna-hero__body">
|
24
27
|
<p>{{ params.text }}</p>
|
25
|
-
</div>
|
26
28
|
{%- elseif params.body -%}
|
27
|
-
<div class="tna-hero__body">
|
28
29
|
{{ params.body | safe }}
|
29
|
-
</div>
|
30
30
|
{%- endif -%}
|
31
|
+
</div>
|
31
32
|
</div>
|
32
33
|
</div>
|
33
|
-
|
34
|
-
</
|
34
|
+
{%- endif -%}
|
35
|
+
</figure>
|
36
|
+
</{{ 'header' if params.heading else 'div' }}>
|