@nationalarchives/frontend 0.1.12-prerelease → 0.1.14-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/nationalarchives/_features.scss +0 -3
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/components/_index.scss +2 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +30 -26
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
- package/nationalarchives/components/breadcrumbs/template.njk +1 -1
- package/nationalarchives/components/button/button.stories.js +1 -1
- package/nationalarchives/components/card/_index.scss +2 -1
- package/nationalarchives/components/card/card.stories.js +1 -1
- package/nationalarchives/components/footer/_index.scss +4 -6
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/template.njk +1 -1
- package/nationalarchives/components/header/_index.scss +43 -11
- package/nationalarchives/components/header/header.stories.js +88 -43
- package/nationalarchives/components/hero/_index.scss +0 -2
- package/nationalarchives/components/hero/hero.stories.js +2 -0
- package/nationalarchives/components/index-grid/_index.scss +44 -0
- package/nationalarchives/components/index-grid/fixtures.json +4 -0
- package/nationalarchives/components/index-grid/index-grid.stories.js +78 -0
- package/nationalarchives/components/index-grid/macro-options.json +94 -0
- package/nationalarchives/components/index-grid/macro.njk +3 -0
- package/nationalarchives/components/index-grid/template.njk +56 -0
- package/nationalarchives/components/message/_index.scss +29 -0
- package/nationalarchives/components/message/fixtures.json +4 -0
- package/nationalarchives/components/message/macro-options.json +20 -0
- package/nationalarchives/components/message/macro.njk +3 -0
- package/nationalarchives/components/message/phase-banner.stories.js +36 -0
- package/nationalarchives/components/message/template.njk +9 -0
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +1 -1
- package/nationalarchives/components/phase-banner/template.njk +1 -1
- package/nationalarchives/components/picture/_index.scss +4 -18
- package/nationalarchives/components/picture/picture.stories.js +1 -1
- package/nationalarchives/components/profile/profile.stories.js +1 -1
- package/nationalarchives/components/profile/template.njk +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +2 -0
- package/nationalarchives/components/tabs/tabs.stories.js +4 -2
- package/nationalarchives/stories/development/publishing.mdx +1 -12
- package/nationalarchives/stories/utilities/colour.stories.js +39 -1
- package/nationalarchives/stories/utilities/heading-groups.stories.js +1 -0
- package/nationalarchives/stories/utilities/headings.stories.js +8 -22
- package/nationalarchives/stories/utilities/typography.mdx +1 -3
- package/nationalarchives/templates/layouts/_generic.njk +42 -50
- package/nationalarchives/tools/_colour.scss +39 -61
- package/nationalarchives/utilities/_global.scss +11 -20
- package/nationalarchives/utilities/_typography.scss +2 -2
- package/nationalarchives/variables/_colour.scss +24 -4
- package/nationalarchives/variables/_typography.scss +4 -2
- package/package.json +3 -3
@@ -1,5 +1,4 @@
|
|
1
1
|
@use "sass:math";
|
2
|
-
@use "../../utilities/global"; // To get %tna-invert
|
3
2
|
@use "../../tools/colour";
|
4
3
|
@use "../../variables/colour" as colourVars; // TODO
|
5
4
|
@use "../../variables/grid";
|
@@ -11,7 +10,7 @@
|
|
11
10
|
|
12
11
|
background-color: colourVars.$tna-black;
|
13
12
|
|
14
|
-
|
13
|
+
@include colour.invert;
|
15
14
|
|
16
15
|
&__exit {
|
17
16
|
padding-top: 0.5rem;
|
@@ -23,8 +22,14 @@
|
|
23
22
|
}
|
24
23
|
|
25
24
|
&__exit-link {
|
26
|
-
color: #fff;
|
27
25
|
text-decoration: none;
|
26
|
+
@include typography.relative-font-size(16);
|
27
|
+
|
28
|
+
&,
|
29
|
+
&:link,
|
30
|
+
&:visited {
|
31
|
+
color: #fff;
|
32
|
+
}
|
28
33
|
|
29
34
|
&:hover {
|
30
35
|
text-decoration: underline;
|
@@ -109,11 +114,26 @@
|
|
109
114
|
color: inherit;
|
110
115
|
text-decoration: none;
|
111
116
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
117
|
+
&,
|
118
|
+
&:link,
|
119
|
+
&:visited {
|
120
|
+
color: inherit;
|
116
121
|
}
|
122
|
+
|
123
|
+
// &--href {
|
124
|
+
// &:hover {
|
125
|
+
// outline: 0.375rem #fff solid;
|
126
|
+
// outline-offset: 1px;
|
127
|
+
|
128
|
+
// // .tna-logo__background {
|
129
|
+
// // fill: #fff;
|
130
|
+
// // }
|
131
|
+
|
132
|
+
// // .tna-logo__foreground {
|
133
|
+
// // fill: #000;
|
134
|
+
// // }
|
135
|
+
// }
|
136
|
+
// }
|
117
137
|
}
|
118
138
|
|
119
139
|
.tna-logo {
|
@@ -123,6 +143,11 @@
|
|
123
143
|
display: inline-block;
|
124
144
|
}
|
125
145
|
|
146
|
+
&__logo-link--href:hover .tna-logo {
|
147
|
+
outline: 0.375rem #fff solid;
|
148
|
+
outline-offset: 1px;
|
149
|
+
}
|
150
|
+
|
126
151
|
.tna-logo__foreground {
|
127
152
|
fill: #fff;
|
128
153
|
}
|
@@ -238,7 +263,9 @@
|
|
238
263
|
|
239
264
|
.tna-header__logo-link {
|
240
265
|
&:hover {
|
241
|
-
|
266
|
+
.tna-logo {
|
267
|
+
outline-color: #000;
|
268
|
+
}
|
242
269
|
}
|
243
270
|
}
|
244
271
|
|
@@ -290,7 +317,7 @@
|
|
290
317
|
}
|
291
318
|
|
292
319
|
&__top-navigation-item {
|
293
|
-
margin-left:
|
320
|
+
margin-left: 1.5rem;
|
294
321
|
|
295
322
|
display: inline-block;
|
296
323
|
}
|
@@ -299,6 +326,7 @@
|
|
299
326
|
display: inline-block;
|
300
327
|
|
301
328
|
text-decoration: none;
|
329
|
+
@include typography.relative-font-size(16);
|
302
330
|
|
303
331
|
&,
|
304
332
|
&:link,
|
@@ -358,8 +386,8 @@
|
|
358
386
|
&,
|
359
387
|
&:link,
|
360
388
|
&:visited {
|
389
|
+
@include colour.uninvert;
|
361
390
|
@include colour.colour-font("font-dark");
|
362
|
-
|
363
391
|
@include colour.colour-background("page-background");
|
364
392
|
}
|
365
393
|
// transition:
|
@@ -411,9 +439,13 @@
|
|
411
439
|
}
|
412
440
|
|
413
441
|
&__navigation {
|
442
|
+
@include colour.uninvert;
|
414
443
|
@include colour.colour-font("font-base");
|
415
444
|
@include typography.relative-font-size(20);
|
416
445
|
|
446
|
+
align-items: stretch;
|
447
|
+
flex-direction: column;
|
448
|
+
|
417
449
|
&.tna-column {
|
418
450
|
padding-right: 0;
|
419
451
|
padding-left: 0;
|
@@ -423,7 +455,7 @@
|
|
423
455
|
display: none;
|
424
456
|
|
425
457
|
&--open {
|
426
|
-
display:
|
458
|
+
display: flex;
|
427
459
|
}
|
428
460
|
}
|
429
461
|
}
|
@@ -24,7 +24,7 @@ Object.keys(argTypes).forEach((argType) => {
|
|
24
24
|
});
|
25
25
|
|
26
26
|
export default {
|
27
|
-
title: "
|
27
|
+
title: "Components/Header",
|
28
28
|
argTypes,
|
29
29
|
parameters: {
|
30
30
|
chromatic: { delay: 1000 },
|
@@ -59,20 +59,20 @@ Standard.args = {
|
|
59
59
|
strapline: "Beta",
|
60
60
|
href: "#/",
|
61
61
|
},
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
62
|
+
topNavigation: [
|
63
|
+
{
|
64
|
+
text: "Top item 1",
|
65
|
+
href: "#/top-1",
|
66
|
+
},
|
67
|
+
{
|
68
|
+
text: "Top item 2",
|
69
|
+
href: "#/top-2",
|
70
|
+
},
|
71
|
+
{
|
72
|
+
text: "Top item 3",
|
73
|
+
href: "#/top-3",
|
74
|
+
},
|
75
|
+
],
|
76
76
|
navigation: [
|
77
77
|
{
|
78
78
|
text: "Alpha",
|
@@ -125,15 +125,17 @@ Desktop.args = {
|
|
125
125
|
classes: "tna-header--demo",
|
126
126
|
};
|
127
127
|
Desktop.play = async ({ canvasElement }) => {
|
128
|
-
|
128
|
+
await new Promise((r) => setTimeout(r, 100));
|
129
|
+
|
130
|
+
const $navigationItems = canvasElement.querySelector(
|
129
131
|
`.tna-header__navigation-items`,
|
130
132
|
);
|
131
|
-
const navigationToggle = canvasElement.querySelector(
|
133
|
+
const $navigationToggle = canvasElement.querySelector(
|
132
134
|
`.tna-header__navigation-toggle-button`,
|
133
135
|
);
|
134
136
|
|
135
|
-
await expect(navigationItems).toBeVisible();
|
136
|
-
await expect(navigationToggle).not.toBeVisible();
|
137
|
+
await expect($navigationItems).toBeVisible();
|
138
|
+
await expect($navigationToggle).not.toBeVisible();
|
137
139
|
};
|
138
140
|
|
139
141
|
export const Mobile = Template.bind({});
|
@@ -164,46 +166,89 @@ Mobile.args = {
|
|
164
166
|
classes: "tna-header--demo",
|
165
167
|
};
|
166
168
|
Mobile.play = async ({ args, canvasElement, step }) => {
|
169
|
+
await new Promise((r) => setTimeout(r, 100));
|
170
|
+
|
167
171
|
const canvas = within(canvasElement);
|
168
172
|
|
169
|
-
const navigationItems = canvasElement.querySelector(
|
173
|
+
const $navigationItems = canvasElement.querySelector(
|
170
174
|
`.tna-header__navigation-items`,
|
171
175
|
);
|
172
|
-
const [linkA, linkB, linkC] = args.navigation.map((navigationItem) =>
|
176
|
+
const [$linkA, $linkB, $linkC] = args.navigation.map((navigationItem) =>
|
173
177
|
canvas.getByText(navigationItem.text),
|
174
178
|
);
|
175
|
-
const navigationToggle = canvasElement.querySelector(
|
179
|
+
const $navigationToggle = canvasElement.querySelector(
|
176
180
|
`.tna-header__navigation-toggle-button`,
|
177
181
|
);
|
178
182
|
|
179
183
|
await step("Initial load", async () => {
|
180
|
-
await expect(navigationItems).not.toBeVisible();
|
181
|
-
await expect(navigationToggle).toBeVisible();
|
182
|
-
await expect(navigationToggle).toHaveAttribute("aria-expanded", "false");
|
183
|
-
await expect(linkA).not.toBeVisible();
|
184
|
-
await expect(linkB).not.toBeVisible();
|
185
|
-
await expect(linkC).not.toBeVisible();
|
184
|
+
await expect($navigationItems).not.toBeVisible();
|
185
|
+
await expect($navigationToggle).toBeVisible();
|
186
|
+
await expect($navigationToggle).toHaveAttribute("aria-expanded", "false");
|
187
|
+
await expect($linkA).not.toBeVisible();
|
188
|
+
await expect($linkB).not.toBeVisible();
|
189
|
+
await expect($linkC).not.toBeVisible();
|
186
190
|
});
|
187
191
|
|
188
192
|
await step("Open the menu", async () => {
|
189
|
-
await userEvent.click(navigationToggle);
|
190
|
-
await expect(navigationItems).toBeVisible();
|
191
|
-
await expect(navigationToggle).toBeVisible();
|
192
|
-
await expect(navigationToggle).toHaveAttribute("aria-expanded", "true");
|
193
|
-
await expect(linkA).toBeVisible();
|
194
|
-
await expect(linkB).toBeVisible();
|
195
|
-
await expect(linkC).toBeVisible();
|
193
|
+
await userEvent.click($navigationToggle);
|
194
|
+
await expect($navigationItems).toBeVisible();
|
195
|
+
await expect($navigationToggle).toBeVisible();
|
196
|
+
await expect($navigationToggle).toHaveAttribute("aria-expanded", "true");
|
197
|
+
await expect($linkA).toBeVisible();
|
198
|
+
await expect($linkB).toBeVisible();
|
199
|
+
await expect($linkC).toBeVisible();
|
196
200
|
});
|
197
201
|
|
198
202
|
await step("Close the menu", async () => {
|
199
|
-
await userEvent.click(navigationToggle);
|
200
|
-
await expect(navigationItems).not.toBeVisible();
|
201
|
-
await expect(navigationToggle).toBeVisible();
|
202
|
-
await expect(navigationToggle).toHaveAttribute("aria-expanded", "false");
|
203
|
-
await expect(linkA).not.toBeVisible();
|
204
|
-
await expect(linkB).not.toBeVisible();
|
205
|
-
await expect(linkC).not.toBeVisible();
|
203
|
+
await userEvent.click($navigationToggle);
|
204
|
+
await expect($navigationItems).not.toBeVisible();
|
205
|
+
await expect($navigationToggle).toBeVisible();
|
206
|
+
await expect($navigationToggle).toHaveAttribute("aria-expanded", "false");
|
207
|
+
await expect($linkA).not.toBeVisible();
|
208
|
+
await expect($linkB).not.toBeVisible();
|
209
|
+
await expect($linkC).not.toBeVisible();
|
206
210
|
});
|
207
211
|
|
208
|
-
navigationToggle.blur();
|
212
|
+
$navigationToggle.blur();
|
209
213
|
};
|
214
|
+
|
215
|
+
// export const NoJavascript = Template.bind({});
|
216
|
+
// NoJavascript.args = {
|
217
|
+
// navigation: [
|
218
|
+
// {
|
219
|
+
// text: "Alpha",
|
220
|
+
// href: "#/alpha",
|
221
|
+
// selected: true,
|
222
|
+
// },
|
223
|
+
// {
|
224
|
+
// text: "Beta",
|
225
|
+
// href: "#/beta",
|
226
|
+
// },
|
227
|
+
// {
|
228
|
+
// text: "Gamma",
|
229
|
+
// href: "#/gamma",
|
230
|
+
// },
|
231
|
+
// ],
|
232
|
+
// classes: "tna-header--demo",
|
233
|
+
// };
|
234
|
+
// NoJavascript.play = async ({ args, canvasElement, step }) => {
|
235
|
+
// document.documentElement.classList.remove("tna-template--js-enabled");
|
236
|
+
// canvasElement.innerHTML = canvasElement.innerHTML;
|
237
|
+
// const $navigationToggleWrapper = canvasElement.querySelector(
|
238
|
+
// `.tna-header__navigation-toggle`,
|
239
|
+
// );
|
240
|
+
// $navigationToggleWrapper.innerHTML = "";
|
241
|
+
|
242
|
+
// const canvas = within(canvasElement);
|
243
|
+
|
244
|
+
// // const $navigationItems = canvasElement.querySelector(
|
245
|
+
// // `.tna-header__navigation-items`,
|
246
|
+
// // );
|
247
|
+
// // const [$linkA, $linkB, $linkC] = args.navigation.map((navigationItem) =>
|
248
|
+
// // canvas.getByText(navigationItem.text),
|
249
|
+
// // );
|
250
|
+
// // await expect($navigationItems).toBeVisible();
|
251
|
+
// // await expect($linkA).toBeVisible();
|
252
|
+
// // await expect($linkB).toBeVisible();
|
253
|
+
// // await expect($linkC).toBeVisible();
|
254
|
+
// };
|
@@ -1,4 +1,3 @@
|
|
1
|
-
@use "../../utilities/global"; // To get %tna-invert
|
2
1
|
@use "../../tools/colour";
|
3
2
|
@use "../../tools/media";
|
4
3
|
|
@@ -106,7 +105,6 @@
|
|
106
105
|
display: block;
|
107
106
|
|
108
107
|
@include colour.invert;
|
109
|
-
// @extend %tna-invert;
|
110
108
|
|
111
109
|
&__image {
|
112
110
|
height: 320px;
|
@@ -51,6 +51,8 @@ Standard.args = {
|
|
51
51
|
};
|
52
52
|
|
53
53
|
Standard.play = async ({ args, canvasElement, step }) => {
|
54
|
+
await new Promise((r) => setTimeout(r, 100));
|
55
|
+
|
54
56
|
const canvas = within(canvasElement);
|
55
57
|
const image = canvas.getByAltText(args.image.alt);
|
56
58
|
const title = canvas.getByText(args.heading);
|
@@ -0,0 +1,44 @@
|
|
1
|
+
@use "../../tools/colour";
|
2
|
+
|
3
|
+
.tna-index-grid {
|
4
|
+
&__item-wrapper {
|
5
|
+
margin-bottom: 2rem;
|
6
|
+
}
|
7
|
+
|
8
|
+
&__item {
|
9
|
+
height: 100%;
|
10
|
+
|
11
|
+
display: flex;
|
12
|
+
flex-direction: column;
|
13
|
+
|
14
|
+
@include colour.invert;
|
15
|
+
text-decoration: none;
|
16
|
+
}
|
17
|
+
|
18
|
+
&__item-image {
|
19
|
+
width: 100%;
|
20
|
+
height: auto;
|
21
|
+
}
|
22
|
+
|
23
|
+
&__item-content {
|
24
|
+
padding: 1rem;
|
25
|
+
|
26
|
+
flex: 1;
|
27
|
+
}
|
28
|
+
|
29
|
+
&__item-title {
|
30
|
+
text-decoration: underline;
|
31
|
+
|
32
|
+
.tna-index-grid__item:hover & {
|
33
|
+
&,
|
34
|
+
&:link,
|
35
|
+
&:visited {
|
36
|
+
text-decoration-thickness: 3px;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
&__item-subtitle {
|
42
|
+
@include colour.colour-font("font-light");
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import IndexGrid from "./template.njk";
|
2
|
+
import macroOptions from "./macro-options.json";
|
3
|
+
|
4
|
+
const argTypes = {
|
5
|
+
heading: { control: "text" },
|
6
|
+
items: { control: "object" },
|
7
|
+
columns: { control: "number" },
|
8
|
+
columnsMedium: { control: "number" },
|
9
|
+
columnsSmall: { control: "number" },
|
10
|
+
columnsTiny: { control: "number" },
|
11
|
+
classes: { control: "text" },
|
12
|
+
attributes: { control: "object" },
|
13
|
+
};
|
14
|
+
|
15
|
+
Object.keys(argTypes).forEach((argType) => {
|
16
|
+
argTypes[argType].description = macroOptions.find(
|
17
|
+
(option) => option.name === argType,
|
18
|
+
)?.description;
|
19
|
+
});
|
20
|
+
|
21
|
+
export default {
|
22
|
+
title: "Components/Index grid",
|
23
|
+
argTypes,
|
24
|
+
};
|
25
|
+
|
26
|
+
const Template = ({
|
27
|
+
heading,
|
28
|
+
items,
|
29
|
+
columns,
|
30
|
+
columnsMedium,
|
31
|
+
columnsSmall,
|
32
|
+
columnsTiny,
|
33
|
+
classes,
|
34
|
+
attributes,
|
35
|
+
}) => {
|
36
|
+
return IndexGrid({
|
37
|
+
params: {
|
38
|
+
heading,
|
39
|
+
items,
|
40
|
+
columns,
|
41
|
+
columnsMedium,
|
42
|
+
columnsSmall,
|
43
|
+
columnsTiny,
|
44
|
+
classes,
|
45
|
+
attributes,
|
46
|
+
},
|
47
|
+
});
|
48
|
+
};
|
49
|
+
|
50
|
+
const exampleItem = {
|
51
|
+
href: "#",
|
52
|
+
src: "https://picsum.photos/id/237/800/600",
|
53
|
+
alt: "Photo of a puppy",
|
54
|
+
width: "800",
|
55
|
+
height: "600",
|
56
|
+
title: "Cat",
|
57
|
+
subtitle: "4 photos",
|
58
|
+
};
|
59
|
+
export const Standard = Template.bind({});
|
60
|
+
Standard.args = {
|
61
|
+
heading: "My dogs",
|
62
|
+
items: Array(12)
|
63
|
+
.fill({ ...exampleItem })
|
64
|
+
.map((item, index) => {
|
65
|
+
const pseudoRandom = ((index * 29) % 8) + 1;
|
66
|
+
return {
|
67
|
+
...item,
|
68
|
+
href: `#/category-${index}`,
|
69
|
+
title: `Category #${index + 101}`,
|
70
|
+
subtitle: `${pseudoRandom} photos`,
|
71
|
+
};
|
72
|
+
}),
|
73
|
+
columns: 4,
|
74
|
+
columnsMedium: 3,
|
75
|
+
columnsSmall: 2,
|
76
|
+
columnsTiny: 1,
|
77
|
+
classes: "tna-index-grid--demo",
|
78
|
+
};
|
@@ -0,0 +1,94 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "heading",
|
4
|
+
"type": "string",
|
5
|
+
"required": true,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "items",
|
10
|
+
"type": "array",
|
11
|
+
"required": true,
|
12
|
+
"description": "",
|
13
|
+
"params": [
|
14
|
+
{
|
15
|
+
"name": "href",
|
16
|
+
"type": "string",
|
17
|
+
"required": true,
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "src",
|
22
|
+
"type": "string",
|
23
|
+
"required": true,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "alt",
|
28
|
+
"type": "string",
|
29
|
+
"required": true,
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "width",
|
34
|
+
"type": "number",
|
35
|
+
"required": true,
|
36
|
+
"description": ""
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"name": "height",
|
40
|
+
"type": "number",
|
41
|
+
"required": true,
|
42
|
+
"description": ""
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "title",
|
46
|
+
"type": "string",
|
47
|
+
"required": true,
|
48
|
+
"description": ""
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "subtitle",
|
52
|
+
"type": "string",
|
53
|
+
"required": false,
|
54
|
+
"description": ""
|
55
|
+
}
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"name": "columns",
|
60
|
+
"type": "string",
|
61
|
+
"required": true,
|
62
|
+
"description": ""
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "columnsMedium",
|
66
|
+
"type": "string",
|
67
|
+
"required": false,
|
68
|
+
"description": ""
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "columnsSmall",
|
72
|
+
"type": "string",
|
73
|
+
"required": false,
|
74
|
+
"description": ""
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "columnsTiny",
|
78
|
+
"type": "string",
|
79
|
+
"required": false,
|
80
|
+
"description": ""
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "classes",
|
84
|
+
"type": "string",
|
85
|
+
"required": false,
|
86
|
+
"description": "Classes to add to the container."
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"name": "attributes",
|
90
|
+
"type": "object",
|
91
|
+
"required": false,
|
92
|
+
"description": "HTML attributes (for example data attributes) to add to the container."
|
93
|
+
}
|
94
|
+
]
|
@@ -0,0 +1,56 @@
|
|
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 %}>
|
3
|
+
<div class="tna-container">
|
4
|
+
<div class="tna-column tna-column--full">
|
5
|
+
<h1>
|
6
|
+
{{ params.heading }}
|
7
|
+
</h1>
|
8
|
+
</div>
|
9
|
+
{%- set itemClasses = ['tna-index-grid__item-wrapper', 'tna-column'] -%}
|
10
|
+
|
11
|
+
{%- if params.columns == 1 -%}
|
12
|
+
{%- set itemClasses = itemClasses.concat('tna-column--full') -%}
|
13
|
+
{%- else -%}
|
14
|
+
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columns) -%}
|
15
|
+
{%- endif -%}
|
16
|
+
|
17
|
+
{%- if params.columnsMedium -%}
|
18
|
+
{%- if params.columnsMedium == 1 -%}
|
19
|
+
{%- set itemClasses = itemClasses.concat('tna-column--full-medium') -%}
|
20
|
+
{%- else -%}
|
21
|
+
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsMedium + '-medium') -%}
|
22
|
+
{%- endif -%}
|
23
|
+
{%- endif -%}
|
24
|
+
|
25
|
+
{%- if params.columnsSmall -%}
|
26
|
+
{%- if params.columnsSmall == 1 -%}
|
27
|
+
{%- set itemClasses = itemClasses.concat('tna-column--full-small') -%}
|
28
|
+
{%- else -%}
|
29
|
+
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsSmall + '-small') -%}
|
30
|
+
{%- endif -%}
|
31
|
+
{%- endif -%}
|
32
|
+
|
33
|
+
{%- if params.columnsTiny -%}
|
34
|
+
{%- if params.columnsTiny == 1 -%}
|
35
|
+
{%- set itemClasses = itemClasses.concat('tna-column--full-tiny') -%}
|
36
|
+
{%- else -%}
|
37
|
+
{%- set itemClasses = itemClasses.concat('tna-column--width-1-' + params.columnsTiny + '-tiny') -%}
|
38
|
+
{%- endif -%}
|
39
|
+
{%- endif -%}
|
40
|
+
|
41
|
+
{%- for item in params.items -%}
|
42
|
+
<div class="{{ itemClasses | join(' ') }}">
|
43
|
+
<a href="{{ item.href }}" class="tna-index-grid__item" title="{{ item.title }}">
|
44
|
+
<img src="{{ item.src }}" class="tna-index-grid__item-image" width="{{ item.width }}" height="{{ item.height }}" alt="{{ item.alt }}" />
|
45
|
+
<span class="tna-index-grid__item-content">
|
46
|
+
<span class="tna-index-grid__item-title">{{ item.title }}</span>
|
47
|
+
{%- if item.subtitle -%}
|
48
|
+
<br>
|
49
|
+
<span class="tna-index-grid__item-subtitle">{{ item.subtitle }}</span>
|
50
|
+
{%- endif -%}
|
51
|
+
</span>
|
52
|
+
</a>
|
53
|
+
</div>
|
54
|
+
{%- endfor -%}
|
55
|
+
</div>
|
56
|
+
<nav>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
@use "../../variables/colour" as colourVars;
|
2
|
+
@use "../../tools/colour";
|
3
|
+
|
4
|
+
.tna-message {
|
5
|
+
padding: 1rem;
|
6
|
+
|
7
|
+
display: flex;
|
8
|
+
align-items: center;
|
9
|
+
|
10
|
+
color: colourVars.$tna-black;
|
11
|
+
|
12
|
+
@include colour.colour-background("keyline");
|
13
|
+
|
14
|
+
border-left: 0.5rem transparent solid;
|
15
|
+
@include colour.colour-border("keyline-dark");
|
16
|
+
|
17
|
+
// &--yellow {
|
18
|
+
background-color: colourVars.$tna-cream;
|
19
|
+
|
20
|
+
border-left-color: colourVars.$tna-yellow;
|
21
|
+
// }
|
22
|
+
|
23
|
+
&__icon {
|
24
|
+
margin-right: 1rem;
|
25
|
+
}
|
26
|
+
|
27
|
+
&__message {
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "message",
|
4
|
+
"type": "string",
|
5
|
+
"required": true,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "classes",
|
10
|
+
"type": "string",
|
11
|
+
"required": false,
|
12
|
+
"description": "Classes to add to the message."
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "attributes",
|
16
|
+
"type": "object",
|
17
|
+
"required": false,
|
18
|
+
"description": "HTML attributes (for example data attributes) to add to the message."
|
19
|
+
}
|
20
|
+
]
|