@nationalarchives/frontend 0.1.15-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/LICENCE +21 -0
- 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/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +13 -41
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +8 -4
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +9 -30
- package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
- package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
- package/nationalarchives/components/breadcrumbs/template.njk +17 -12
- package/nationalarchives/components/button/_button-group.scss +18 -0
- package/nationalarchives/components/button/_index.scss +25 -9
- package/nationalarchives/components/button/button.stories.js +64 -8
- 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 +67 -51
- package/nationalarchives/components/card/card.stories.js +123 -10
- package/nationalarchives/components/card/fixtures.json +62 -10
- package/nationalarchives/components/card/macro-options.json +9 -3
- package/nationalarchives/components/card/template.njk +12 -8
- package/nationalarchives/components/filters/_index.scss +19 -14
- package/nationalarchives/components/filters/filters.stories.js +3 -4
- package/nationalarchives/components/footer/_index.scss +195 -72
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +82 -74
- package/nationalarchives/components/footer/macro-options.json +34 -8
- package/nationalarchives/components/footer/template.njk +110 -53
- package/nationalarchives/components/grid/_index.scss +2 -2
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/header/_index.scss +57 -23
- package/nationalarchives/components/header/header.stories.js +2 -3
- package/nationalarchives/components/hero/_index.scss +4 -8
- package/nationalarchives/components/hero/hero.stories.js +2 -3
- package/nationalarchives/components/index-grid/_index.scss +28 -7
- package/nationalarchives/components/index-grid/index-grid.stories.js +27 -4
- 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 +12 -6
- package/nationalarchives/components/message/phase-banner.stories.js +2 -3
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
- package/nationalarchives/components/picture/_index.scss +5 -5
- 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/picture/picture.stories.js +2 -3
- package/nationalarchives/components/profile/profile.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
- package/nationalarchives/components/skip-link/_index.scss +63 -0
- package/nationalarchives/components/skip-link/fixtures.json +11 -0
- package/nationalarchives/{patterns/featured-collection → components/skip-link}/macro-options.json +10 -4
- package/nationalarchives/components/skip-link/macro.njk +3 -0
- package/nationalarchives/{patterns/featured-collection/featured-collection.stories.js → components/skip-link/skip-link.stories.js} +7 -10
- package/nationalarchives/components/skip-link/template.njk +4 -0
- package/nationalarchives/components/tabs/_index.scss +7 -5
- package/nationalarchives/components/tabs/tabs.stories.js +8 -9
- 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 +494 -91
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +8 -14
- 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/templates/layouts/_generic.njk +10 -8
- package/nationalarchives/tools/_colour.scss +163 -49
- package/nationalarchives/tools/_index.scss +0 -1
- package/nationalarchives/tools/_typography.scss +13 -0
- package/nationalarchives/utilities/_debug.scss +41 -1
- package/nationalarchives/utilities/_font-awesome.scss +5 -0
- package/nationalarchives/utilities/_global.scss +75 -26
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +54 -9
- package/nationalarchives/utilities/_typography.scss +203 -65
- package/nationalarchives/variables/_assets.scss +1 -1
- package/nationalarchives/variables/_colour.scss +93 -93
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_media.scss +23 -23
- package/nationalarchives/variables/_spacing.scss +12 -2
- package/nationalarchives/variables/_typography.scss +4 -1
- package/package.json +14 -14
- package/nationalarchives/patterns/_index.scss +0 -1
- package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
- package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
- package/nationalarchives/patterns/featured-collection/template.njk +0 -96
- package/nationalarchives/tools/_assets.scss +0 -5
@@ -5,10 +5,49 @@
|
|
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
|
|
11
|
-
|
48
|
+
color: colour.brand-colour("white");
|
49
|
+
|
50
|
+
background-color: colour.brand-colour("black");
|
12
51
|
|
13
52
|
&__exit {
|
14
53
|
padding-top: 0.5rem;
|
@@ -262,7 +301,7 @@
|
|
262
301
|
&--orange,
|
263
302
|
&--green,
|
264
303
|
&--blue {
|
265
|
-
color:
|
304
|
+
color: colour.brand-colour("black");
|
266
305
|
|
267
306
|
.tna-header__logo-link {
|
268
307
|
&:hover {
|
@@ -277,28 +316,28 @@
|
|
277
316
|
}
|
278
317
|
|
279
318
|
.tna-header__hamburger {
|
280
|
-
background-color:
|
319
|
+
background-color: colour.brand-colour("black");
|
281
320
|
}
|
282
321
|
}
|
283
322
|
|
284
323
|
&--yellow {
|
285
|
-
background-color:
|
324
|
+
background-color: colour.brand-colour("yellow");
|
286
325
|
}
|
287
326
|
|
288
327
|
&--pink {
|
289
|
-
background-color:
|
328
|
+
background-color: colour.brand-colour("pink");
|
290
329
|
}
|
291
330
|
|
292
331
|
&--orange {
|
293
|
-
background-color:
|
332
|
+
background-color: colour.brand-colour("orange");
|
294
333
|
}
|
295
334
|
|
296
335
|
&--green {
|
297
|
-
background-color:
|
336
|
+
background-color: colour.brand-colour("green");
|
298
337
|
}
|
299
338
|
|
300
339
|
&--blue {
|
301
|
-
background-color:
|
340
|
+
background-color: colour.brand-colour("blue");
|
302
341
|
}
|
303
342
|
|
304
343
|
&__navigation {
|
@@ -342,8 +381,7 @@
|
|
342
381
|
&,
|
343
382
|
&:link,
|
344
383
|
&:visited {
|
345
|
-
text-decoration
|
346
|
-
text-decoration-thickness: 3px;
|
384
|
+
@include typography.interacted-text-decoration;
|
347
385
|
}
|
348
386
|
}
|
349
387
|
}
|
@@ -389,7 +427,7 @@
|
|
389
427
|
&,
|
390
428
|
&:link,
|
391
429
|
&:visited {
|
392
|
-
@include
|
430
|
+
@include uninvert;
|
393
431
|
@include colour.colour-font("font-dark");
|
394
432
|
@include colour.colour-background("page-background");
|
395
433
|
}
|
@@ -406,8 +444,6 @@
|
|
406
444
|
}
|
407
445
|
|
408
446
|
@include media.on-mobile {
|
409
|
-
$compensated-container-padding: grid.$gutter-width-mobile + 0.75rem;
|
410
|
-
|
411
447
|
&__contents {
|
412
448
|
&.tna-container {
|
413
449
|
padding-right: 0;
|
@@ -420,8 +456,8 @@
|
|
420
456
|
padding-bottom: 1rem;
|
421
457
|
|
422
458
|
&.tna-column {
|
423
|
-
padding-right:
|
424
|
-
padding-left:
|
459
|
+
padding-right: grid.$gutter-width-mobile;
|
460
|
+
padding-left: grid.$gutter-width-mobile;
|
425
461
|
}
|
426
462
|
}
|
427
463
|
|
@@ -436,13 +472,13 @@
|
|
436
472
|
|
437
473
|
&__navigation-toggle {
|
438
474
|
&.tna-column {
|
439
|
-
padding-right:
|
475
|
+
padding-right: grid.$gutter-width-mobile;
|
440
476
|
padding-left: 0;
|
441
477
|
}
|
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
|
|
@@ -470,8 +506,7 @@
|
|
470
506
|
|
471
507
|
@include colour.colour-background("page-background");
|
472
508
|
|
473
|
-
border
|
474
|
-
@include colour.colour-border("keyline");
|
509
|
+
@include colour.colour-border("keyline", 1px, solid, bottom);
|
475
510
|
}
|
476
511
|
|
477
512
|
&__top-navigation-item {
|
@@ -493,13 +528,12 @@
|
|
493
528
|
|
494
529
|
display: block;
|
495
530
|
|
496
|
-
border
|
497
|
-
@include colour.colour-border("keyline");
|
531
|
+
@include colour.colour-border("keyline", 1px, solid, bottom);
|
498
532
|
}
|
499
533
|
|
500
534
|
&__navigation-item-link {
|
501
|
-
padding-right:
|
502
|
-
padding-left:
|
535
|
+
padding-right: grid.$gutter-width-mobile;
|
536
|
+
padding-left: grid.$gutter-width-mobile + 1rem;
|
503
537
|
|
504
538
|
display: block;
|
505
539
|
|
@@ -39,8 +39,8 @@ const Template = ({
|
|
39
39
|
exit,
|
40
40
|
classes,
|
41
41
|
attributes,
|
42
|
-
}) =>
|
43
|
-
|
42
|
+
}) =>
|
43
|
+
Header({
|
44
44
|
params: {
|
45
45
|
logo,
|
46
46
|
topNavigation,
|
@@ -51,7 +51,6 @@ const Template = ({
|
|
51
51
|
attributes,
|
52
52
|
},
|
53
53
|
});
|
54
|
-
};
|
55
54
|
|
56
55
|
export const Standard = Template.bind({});
|
57
56
|
Standard.args = {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
.tna-hero {
|
5
5
|
min-height: min(35vw, 480px);
|
6
|
-
margin-bottom: 2rem;
|
6
|
+
// margin-bottom: 2rem;
|
7
7
|
padding-top: 5rem;
|
8
8
|
padding-bottom: 3rem;
|
9
9
|
|
@@ -12,6 +12,8 @@
|
|
12
12
|
|
13
13
|
position: relative;
|
14
14
|
|
15
|
+
@include colour.invert-on-mobile;
|
16
|
+
|
15
17
|
&__image {
|
16
18
|
width: 100%;
|
17
19
|
height: 100%;
|
@@ -105,8 +107,6 @@
|
|
105
107
|
|
106
108
|
display: block;
|
107
109
|
|
108
|
-
@include colour.invert;
|
109
|
-
|
110
110
|
&__image {
|
111
111
|
height: 320px;
|
112
112
|
|
@@ -142,13 +142,10 @@
|
|
142
142
|
}
|
143
143
|
|
144
144
|
&__heading {
|
145
|
-
color: inherit;
|
146
145
|
}
|
147
146
|
|
148
147
|
&__body {
|
149
148
|
margin-top: 1rem;
|
150
|
-
|
151
|
-
color: inherit;
|
152
149
|
}
|
153
150
|
}
|
154
151
|
|
@@ -160,8 +157,7 @@
|
|
160
157
|
|
161
158
|
@include colour.on-high-contrast {
|
162
159
|
&__content-inner {
|
163
|
-
border
|
164
|
-
@include colour.colour-border("keyline-dark");
|
160
|
+
@include colour.colour-border("keyline-dark", 1px);
|
165
161
|
|
166
162
|
@include media.on-mobile {
|
167
163
|
border: none;
|
@@ -23,8 +23,8 @@ export default {
|
|
23
23
|
argTypes,
|
24
24
|
};
|
25
25
|
|
26
|
-
const Template = ({ heading, body, text, image, classes, attributes }) =>
|
27
|
-
|
26
|
+
const Template = ({ heading, body, text, image, classes, attributes }) =>
|
27
|
+
Hero({
|
28
28
|
params: {
|
29
29
|
heading,
|
30
30
|
body,
|
@@ -34,7 +34,6 @@ const Template = ({ heading, body, text, image, classes, attributes }) => {
|
|
34
34
|
attributes,
|
35
35
|
},
|
36
36
|
});
|
37
|
-
};
|
38
37
|
|
39
38
|
export const Standard = Template.bind({});
|
40
39
|
Standard.args = {
|
@@ -1,40 +1,52 @@
|
|
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 {
|
28
|
-
border
|
29
|
-
@include colour.colour-border("keyline-dark");
|
40
|
+
@include colour.colour-border("keyline-dark", 1px);
|
30
41
|
}
|
31
42
|
}
|
32
43
|
|
33
44
|
&__item-image {
|
34
45
|
width: 100%;
|
35
|
-
height: #{math.div(2, 3) * 100%};
|
46
|
+
// height: #{math.div(2, 3) * 100%};
|
47
|
+
height: auto;
|
36
48
|
|
37
|
-
object-fit: cover;
|
49
|
+
// object-fit: cover;
|
38
50
|
}
|
39
51
|
|
40
52
|
&__item-content {
|
@@ -43,19 +55,28 @@
|
|
43
55
|
flex: 1;
|
44
56
|
}
|
45
57
|
|
58
|
+
&__item-label {
|
59
|
+
position: absolute;
|
60
|
+
top: 0.5rem;
|
61
|
+
left: 0.5rem;
|
62
|
+
}
|
63
|
+
|
46
64
|
&__item-title {
|
65
|
+
// @include typography.heading-font;
|
47
66
|
text-decoration: underline;
|
67
|
+
// @include typography.relative-font-size(20);
|
48
68
|
|
49
69
|
.tna-index-grid__item:hover & {
|
50
70
|
&,
|
51
71
|
&:link,
|
52
72
|
&:visited {
|
53
|
-
text-decoration
|
73
|
+
@include typography.interacted-text-decoration;
|
54
74
|
}
|
55
75
|
}
|
56
76
|
}
|
57
77
|
|
58
78
|
&__item-subtitle {
|
59
79
|
@include colour.colour-font("font-light");
|
80
|
+
@include typography.relative-font-size(16);
|
60
81
|
}
|
61
82
|
}
|
@@ -32,8 +32,8 @@ const Template = ({
|
|
32
32
|
columnsTiny,
|
33
33
|
classes,
|
34
34
|
attributes,
|
35
|
-
}) =>
|
36
|
-
|
35
|
+
}) =>
|
36
|
+
IndexGrid({
|
37
37
|
params: {
|
38
38
|
heading,
|
39
39
|
items,
|
@@ -45,7 +45,6 @@ const Template = ({
|
|
45
45
|
attributes,
|
46
46
|
},
|
47
47
|
});
|
48
|
-
};
|
49
48
|
|
50
49
|
const exampleItem = {
|
51
50
|
href: "#",
|
@@ -54,13 +53,14 @@ const exampleItem = {
|
|
54
53
|
width: "800",
|
55
54
|
height: "600",
|
56
55
|
title: "Cat",
|
57
|
-
subtitle: "4 photos",
|
58
56
|
};
|
57
|
+
|
59
58
|
export const Standard = Template.bind({});
|
60
59
|
Standard.args = {
|
61
60
|
heading: {
|
62
61
|
title: "My dogs",
|
63
62
|
level: 2,
|
63
|
+
href: "#",
|
64
64
|
},
|
65
65
|
items: Array(12)
|
66
66
|
.fill({ ...exampleItem })
|
@@ -69,6 +69,7 @@ Standard.args = {
|
|
69
69
|
return {
|
70
70
|
...item,
|
71
71
|
href: `#/category-${index}`,
|
72
|
+
label: "Time period",
|
72
73
|
title: `Category #${index + 101}`,
|
73
74
|
subtitle: `${pseudoRandom} photos`,
|
74
75
|
};
|
@@ -79,3 +80,25 @@ Standard.args = {
|
|
79
80
|
columnsTiny: 1,
|
80
81
|
classes: "tna-index-grid--demo",
|
81
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,5 +1,5 @@
|
|
1
|
-
@use "../../variables/colour" as colourVars; // TODO
|
2
1
|
@use "../../tools/colour";
|
2
|
+
@use "../../tools/media";
|
3
3
|
|
4
4
|
.tna-message {
|
5
5
|
padding: 1rem;
|
@@ -7,23 +7,29 @@
|
|
7
7
|
display: flex;
|
8
8
|
align-items: center;
|
9
9
|
|
10
|
-
color:
|
10
|
+
color: colour.brand-colour("black");
|
11
11
|
|
12
12
|
@include colour.colour-background("keyline");
|
13
13
|
|
14
|
-
border-
|
15
|
-
@include colour.colour-border("keyline-dark");
|
14
|
+
@include colour.colour-border("keyline-dark", 0.5rem, solid, left);
|
16
15
|
|
17
16
|
// &--yellow {
|
18
|
-
background-color:
|
17
|
+
background-color: colour.brand-colour("cream");
|
19
18
|
|
20
|
-
border-left-color:
|
19
|
+
border-left-color: colour.brand-colour("yellow");
|
21
20
|
// }
|
22
21
|
|
23
22
|
&__icon {
|
24
23
|
margin-right: 1rem;
|
24
|
+
|
25
|
+
flex: 0 0 2.5rem;
|
26
|
+
|
27
|
+
@include media.on-mobile {
|
28
|
+
flex: 0 0 1.5rem;
|
29
|
+
}
|
25
30
|
}
|
26
31
|
|
27
32
|
&__message {
|
33
|
+
flex: 1;
|
28
34
|
}
|
29
35
|
}
|
@@ -18,15 +18,14 @@ export default {
|
|
18
18
|
argTypes,
|
19
19
|
};
|
20
20
|
|
21
|
-
const Template = ({ message, classes, attributes }) =>
|
22
|
-
|
21
|
+
const Template = ({ message, classes, attributes }) =>
|
22
|
+
Message({
|
23
23
|
params: {
|
24
24
|
message,
|
25
25
|
classes,
|
26
26
|
attributes,
|
27
27
|
},
|
28
28
|
});
|
29
|
-
};
|
30
29
|
|
31
30
|
export const Standard = Template.bind({});
|
32
31
|
Standard.args = {
|
@@ -22,8 +22,8 @@ export default {
|
|
22
22
|
argTypes,
|
23
23
|
};
|
24
24
|
|
25
|
-
const Template = ({ phase, message, classes, attributes }) =>
|
26
|
-
|
25
|
+
const Template = ({ phase, message, classes, attributes }) =>
|
26
|
+
PhaseBanner({
|
27
27
|
params: {
|
28
28
|
phase,
|
29
29
|
message,
|
@@ -31,7 +31,6 @@ const Template = ({ phase, message, classes, attributes }) => {
|
|
31
31
|
attributes,
|
32
32
|
},
|
33
33
|
});
|
34
|
-
};
|
35
34
|
|
36
35
|
export const Discovery = Template.bind({});
|
37
36
|
Discovery.args = {
|
@@ -34,6 +34,8 @@
|
|
34
34
|
|
35
35
|
padding: 1rem 1.5rem;
|
36
36
|
|
37
|
+
// @include colour.colour-font("font-base");
|
38
|
+
|
37
39
|
.tna-template--clicked &:focus {
|
38
40
|
outline: none;
|
39
41
|
}
|
@@ -50,13 +52,11 @@
|
|
50
52
|
|
51
53
|
text-align: center;
|
52
54
|
|
53
|
-
border
|
54
|
-
@include colour.colour-border("keyline");
|
55
|
+
@include colour.colour-border("keyline", 1px, solid, bottom);
|
55
56
|
}
|
56
57
|
|
57
58
|
@include colour.on-high-contrast {
|
58
|
-
border-
|
59
|
-
|
60
|
-
border-style: solid;
|
59
|
+
@include colour.colour-border("keyline-dark", 1px);
|
60
|
+
border-bottom-width: 0;
|
61
61
|
}
|
62
62
|
}
|
@@ -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
|