@nationalarchives/frontend 0.1.18-prerelease → 0.1.19-prerelease
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nationalarchives/all.css +12 -2
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +26 -2
- package/nationalarchives/all.scss +20 -4
- package/nationalarchives/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/nationalarchives/assets/fonts/OpenSans-Medium.ttf +0 -0
- package/nationalarchives/assets/fonts/RobotoMono-Regular.ttf +0 -0
- package/nationalarchives/components/_index.scss +18 -16
- package/nationalarchives/components/breadcrumbs/_index.scss +1 -109
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +111 -0
- package/nationalarchives/components/button/_button-group.scss +3 -5
- package/nationalarchives/components/button/_index.scss +1 -73
- package/nationalarchives/components/button/button.css +13 -0
- package/nationalarchives/components/button/button.css.map +1 -0
- package/nationalarchives/components/button/button.scss +103 -0
- package/nationalarchives/components/button/button.stories.js +61 -0
- package/nationalarchives/components/button/macro-options.json +19 -1
- package/nationalarchives/components/button/template.njk +8 -2
- package/nationalarchives/components/card/_index.scss +1 -183
- package/nationalarchives/components/card/card.css +13 -0
- package/nationalarchives/components/card/card.css.map +1 -0
- package/nationalarchives/components/card/card.scss +171 -0
- package/nationalarchives/components/card/card.stories.js +185 -95
- package/nationalarchives/components/card/fixtures.json +57 -28
- package/nationalarchives/components/card/macro-options.json +77 -48
- package/nationalarchives/components/card/template.njk +47 -37
- package/nationalarchives/components/cookie-banner/_index.scss +1 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.css +13 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.js +2 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.mjs +83 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.scss +32 -0
- package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +164 -0
- package/nationalarchives/components/cookie-banner/fixtures.json +4 -0
- package/nationalarchives/components/cookie-banner/macro-options.json +38 -0
- package/nationalarchives/components/cookie-banner/macro.njk +3 -0
- package/nationalarchives/components/cookie-banner/template.njk +61 -0
- package/nationalarchives/components/filters/_index.scss +1 -54
- package/nationalarchives/components/filters/filters.css +1 -0
- package/nationalarchives/components/filters/filters.css.map +1 -0
- package/nationalarchives/components/filters/filters.scss +53 -0
- package/nationalarchives/components/footer/_index.scss +1 -270
- package/nationalarchives/components/footer/footer.css +13 -0
- package/nationalarchives/components/footer/footer.css.map +1 -0
- package/nationalarchives/components/footer/footer.scss +265 -0
- package/nationalarchives/components/footer/footer.stories.js +6 -6
- package/nationalarchives/components/footer/macro-options.json +7 -1
- package/nationalarchives/components/footer/template.njk +10 -6
- package/nationalarchives/components/gallery/_index.scss +1 -0
- package/nationalarchives/components/gallery/fixtures.json +4 -0
- package/nationalarchives/components/gallery/gallery.css +13 -0
- package/nationalarchives/components/gallery/gallery.css.map +1 -0
- package/nationalarchives/components/gallery/gallery.js +2 -0
- package/nationalarchives/components/gallery/gallery.js.map +1 -0
- package/nationalarchives/components/gallery/gallery.mjs +80 -0
- package/nationalarchives/components/gallery/gallery.scss +129 -0
- package/nationalarchives/components/gallery/gallery.stories.js +76 -0
- package/nationalarchives/components/gallery/macro-options.json +104 -0
- package/nationalarchives/components/gallery/macro.njk +3 -0
- package/nationalarchives/components/gallery/template.njk +45 -0
- package/nationalarchives/components/grid/_index.scss +1 -79
- package/nationalarchives/components/grid/grid.css +1 -0
- package/nationalarchives/components/grid/grid.css.map +1 -0
- package/nationalarchives/components/grid/grid.scss +81 -0
- package/nationalarchives/components/header/_index.scss +1 -586
- package/nationalarchives/components/header/header.css +1 -0
- package/nationalarchives/components/header/header.css.map +1 -0
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.scss +594 -0
- package/nationalarchives/components/header/header.stories.js +5 -5
- package/nationalarchives/components/hero/_index.scss +1 -167
- package/nationalarchives/components/hero/hero.css +1 -0
- package/nationalarchives/components/hero/hero.css.map +1 -0
- package/nationalarchives/components/hero/hero.scss +169 -0
- package/nationalarchives/components/index-grid/_index.scss +1 -82
- package/nationalarchives/components/index-grid/index-grid.css +1 -0
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -0
- package/nationalarchives/components/index-grid/index-grid.scss +84 -0
- package/nationalarchives/components/message/_index.scss +1 -35
- package/nationalarchives/components/message/message.css +1 -0
- package/nationalarchives/components/message/message.css.map +1 -0
- package/nationalarchives/components/message/message.scss +36 -0
- package/nationalarchives/components/phase-banner/_index.scss +1 -60
- package/nationalarchives/components/phase-banner/fixtures.json +8 -8
- package/nationalarchives/components/phase-banner/phase-banner.css +1 -0
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -0
- package/nationalarchives/components/phase-banner/phase-banner.scss +31 -0
- package/nationalarchives/components/phase-banner/template.njk +2 -2
- package/nationalarchives/components/picture/_index.scss +1 -62
- package/nationalarchives/components/picture/picture.css +13 -0
- package/nationalarchives/components/picture/picture.css.map +1 -0
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/picture/picture.mjs +2 -1
- package/nationalarchives/components/picture/picture.scss +65 -0
- package/nationalarchives/components/profile/_index.scss +1 -2
- package/nationalarchives/components/profile/profile.css +1 -0
- package/nationalarchives/components/profile/profile.css.map +1 -0
- package/nationalarchives/components/profile/profile.scss +5 -0
- package/nationalarchives/components/sensitive-image/_index.scss +1 -77
- package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.js +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.scss +78 -0
- package/nationalarchives/components/skip-link/_index.scss +1 -63
- package/nationalarchives/components/skip-link/skip-link.css +1 -0
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -0
- package/nationalarchives/components/skip-link/skip-link.scss +61 -0
- package/nationalarchives/components/tabs/_index.scss +1 -144
- package/nationalarchives/components/tabs/tabs.css +1 -0
- package/nationalarchives/components/tabs/tabs.css.map +1 -0
- package/nationalarchives/components/tabs/tabs.js +1 -1
- package/nationalarchives/components/tabs/tabs.js.map +1 -1
- package/nationalarchives/components/tabs/tabs.mjs +2 -0
- package/nationalarchives/components/tabs/tabs.scss +143 -0
- package/nationalarchives/components/tabs/tabs.stories.js +0 -1
- package/nationalarchives/lib/_font-awesome.scss +5 -0
- package/nationalarchives/lib/_index.scss +1 -0
- package/nationalarchives/lib/cookies.mjs +110 -0
- package/nationalarchives/lib/font-awesome/brands.css +5 -0
- package/nationalarchives/lib/font-awesome/brands.css.map +1 -0
- package/nationalarchives/lib/font-awesome/fontawesome.css +5 -0
- package/nationalarchives/lib/font-awesome/fontawesome.css.map +1 -0
- package/nationalarchives/lib/font-awesome/regular.css +5 -0
- package/nationalarchives/lib/font-awesome/regular.css.map +1 -0
- package/nationalarchives/lib/font-awesome/solid.css +5 -0
- package/nationalarchives/lib/font-awesome/solid.css.map +1 -0
- package/nationalarchives/lib/font-awesome/v4-shims.css +5 -0
- package/nationalarchives/lib/font-awesome/v4-shims.css.map +1 -0
- package/nationalarchives/stories/development/about.mdx +60 -0
- package/nationalarchives/stories/development/contributing.mdx +8 -5
- package/nationalarchives/stories/development/relationships.mdx +57 -0
- package/nationalarchives/stories/development/using.mdx +75 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +176 -50
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +3 -3
- package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
- package/nationalarchives/templates/layouts/_generic.njk +6 -1
- package/nationalarchives/tools/_colour.scss +55 -17
- package/nationalarchives/tools/_index.scss +5 -4
- package/nationalarchives/tools/_spacing.scss +22 -0
- package/nationalarchives/tools/_typography.scss +0 -4
- package/nationalarchives/utilities/_a11y.scss +24 -0
- package/nationalarchives/utilities/_global.scss +3 -29
- package/nationalarchives/utilities/_index.scss +5 -5
- package/nationalarchives/utilities/_overrides.scss +5 -15
- package/nationalarchives/utilities/_typography.scss +68 -57
- package/nationalarchives/variables/_colour.scss +17 -9
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_spacing.scss +12 -12
- package/nationalarchives/variables/_typography.scss +7 -7
- package/package.json +5 -2
- package/nationalarchives/assets/images/footer/facebook.svg +0 -11
- package/nationalarchives/assets/images/footer/flickr.svg +0 -11
- package/nationalarchives/assets/images/footer/instagram.svg +0 -17
- package/nationalarchives/assets/images/footer/rss.svg +0 -13
- package/nationalarchives/assets/images/footer/twitter.svg +0 -14
- package/nationalarchives/assets/images/footer/youtube.svg +0 -12
- package/nationalarchives/stories/development/dependencies.mdx +0 -11
- package/nationalarchives/stories/development/relationships.md +0 -91
- package/nationalarchives/stories/development/technologies.mdx +0 -65
- package/nationalarchives/utilities/_font-awesome.scss +0 -5
@@ -0,0 +1,171 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
@use "../../tools/colour";
|
3
|
+
@use "../../tools/typography";
|
4
|
+
@use "../../tools/media";
|
5
|
+
@use "../../tools/spacing";
|
6
|
+
@use "../../utilities";
|
7
|
+
@use "../button";
|
8
|
+
|
9
|
+
.tna-card {
|
10
|
+
@include spacing.space-below;
|
11
|
+
|
12
|
+
&__inner {
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
}
|
16
|
+
|
17
|
+
&__heading {
|
18
|
+
order: 2;
|
19
|
+
}
|
20
|
+
|
21
|
+
&__heading-link {
|
22
|
+
&::after {
|
23
|
+
display: none !important;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
&__image-container {
|
28
|
+
height: 0;
|
29
|
+
margin-bottom: 1rem;
|
30
|
+
// padding-bottom: #{math.div(9, 16) * 100%};
|
31
|
+
padding-bottom: #{math.div(2, 3) * 100%};
|
32
|
+
|
33
|
+
position: relative;
|
34
|
+
order: 1;
|
35
|
+
}
|
36
|
+
|
37
|
+
&__image {
|
38
|
+
position: absolute;
|
39
|
+
inset: 0;
|
40
|
+
|
41
|
+
img {
|
42
|
+
width: 100%;
|
43
|
+
height: 100%;
|
44
|
+
|
45
|
+
object-fit: cover;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
&__image-label {
|
50
|
+
max-width: calc(100% - 1rem);
|
51
|
+
|
52
|
+
position: absolute;
|
53
|
+
top: 0.5rem;
|
54
|
+
left: 0.5rem;
|
55
|
+
}
|
56
|
+
|
57
|
+
&__body {
|
58
|
+
order: 3;
|
59
|
+
}
|
60
|
+
|
61
|
+
&__actions {
|
62
|
+
margin-top: 2rem;
|
63
|
+
|
64
|
+
order: 4;
|
65
|
+
}
|
66
|
+
|
67
|
+
&__action {
|
68
|
+
@include typography.main-font-weight-bold;
|
69
|
+
|
70
|
+
.fa,
|
71
|
+
.fa-regular,
|
72
|
+
.fa-solid,
|
73
|
+
.fa-brands {
|
74
|
+
margin-right: 0.5rem;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
&--contrast,
|
79
|
+
&--accent {
|
80
|
+
.tna-card__inner {
|
81
|
+
padding-bottom: 1rem;
|
82
|
+
}
|
83
|
+
|
84
|
+
.tna-card__heading,
|
85
|
+
.tna-card__body,
|
86
|
+
.tna-card__actions {
|
87
|
+
margin-right: 1rem;
|
88
|
+
margin-left: 1rem;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
&--contrast {
|
93
|
+
@include colour.invert;
|
94
|
+
}
|
95
|
+
|
96
|
+
&--accent {
|
97
|
+
@include colour.accent;
|
98
|
+
|
99
|
+
.tna-hgroup__supertitle {
|
100
|
+
@include colour.invert;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
&--horizontal {
|
105
|
+
position: relative;
|
106
|
+
|
107
|
+
@include media.on-larger-than-mobile {
|
108
|
+
.tna-card__inner {
|
109
|
+
margin-left: 50%;
|
110
|
+
padding: 2rem;
|
111
|
+
}
|
112
|
+
|
113
|
+
.tna-card__image-container {
|
114
|
+
height: auto;
|
115
|
+
margin-bottom: 0;
|
116
|
+
padding-bottom: 0;
|
117
|
+
|
118
|
+
display: block;
|
119
|
+
|
120
|
+
position: absolute;
|
121
|
+
inset: 0 50% 0 0;
|
122
|
+
}
|
123
|
+
|
124
|
+
.tna-card__heading,
|
125
|
+
.tna-card__body,
|
126
|
+
.tna-card__actions {
|
127
|
+
margin-right: 0;
|
128
|
+
margin-left: 0;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
&--horizontal#{&}--contrast,
|
134
|
+
&--horizontal#{&}--accent {
|
135
|
+
@include media.on-mobile {
|
136
|
+
.tna-card__inner {
|
137
|
+
padding: 0 0 2rem;
|
138
|
+
}
|
139
|
+
|
140
|
+
.tna-card__image-container {
|
141
|
+
margin-bottom: 2rem;
|
142
|
+
}
|
143
|
+
|
144
|
+
.tna-card__heading,
|
145
|
+
.tna-card__body,
|
146
|
+
.tna-card__actions {
|
147
|
+
margin-right: 2rem;
|
148
|
+
margin-left: 2rem;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
&:not(#{&}--horizontal) {
|
154
|
+
@include colour.on-high-contrast {
|
155
|
+
.tna-card__inner {
|
156
|
+
padding-bottom: 1rem;
|
157
|
+
}
|
158
|
+
|
159
|
+
.tna-card__heading,
|
160
|
+
.tna-card__body,
|
161
|
+
.tna-card__actions {
|
162
|
+
margin-right: 1rem;
|
163
|
+
margin-left: 1rem;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
@include colour.on-high-contrast {
|
169
|
+
@include colour.colour-border("keyline-dark", 1px);
|
170
|
+
}
|
171
|
+
}
|
@@ -2,24 +2,33 @@ import Card from "./template.njk";
|
|
2
2
|
import macroOptions from "./macro-options.json";
|
3
3
|
|
4
4
|
const argTypes = {
|
5
|
-
|
5
|
+
title: { control: "text" },
|
6
|
+
supertitle: { control: "text" },
|
7
|
+
headingLevel: { control: { type: "number", min: 1, max: 6 } },
|
8
|
+
headingSize: { control: "inline-radio", options: ["m", "l"] },
|
6
9
|
href: { control: "text" },
|
7
|
-
|
10
|
+
imageSrc: { control: { type: "file", accept: ".jpg" } },
|
11
|
+
imageAlt: { control: "text" },
|
12
|
+
imageWidth: { control: { type: "number", min: 1 } },
|
13
|
+
imageHeight: { control: { type: "number", min: 1 } },
|
14
|
+
imageSources: { control: "object" },
|
8
15
|
label: { control: "text" },
|
9
16
|
body: { control: "text" },
|
10
17
|
text: { control: "text" },
|
11
18
|
actions: { control: "object" },
|
12
19
|
horizontal: { control: "boolean" },
|
13
|
-
style: { control: "
|
20
|
+
style: { control: "inline-radio", options: ["none", "boxed", "accent"] },
|
14
21
|
htmlElement: { control: "text" },
|
15
22
|
classes: { control: "text" },
|
16
23
|
attributes: { control: "object" },
|
17
24
|
};
|
18
25
|
|
19
26
|
Object.keys(argTypes).forEach((argType) => {
|
20
|
-
|
21
|
-
|
22
|
-
|
27
|
+
const macroOption = macroOptions.find((option) => option.name === argType);
|
28
|
+
argTypes[argType] = {
|
29
|
+
...argTypes[argType],
|
30
|
+
description: macroOption?.description,
|
31
|
+
};
|
23
32
|
});
|
24
33
|
|
25
34
|
export default {
|
@@ -28,9 +37,16 @@ export default {
|
|
28
37
|
};
|
29
38
|
|
30
39
|
const Template = ({
|
31
|
-
|
40
|
+
title,
|
41
|
+
supertitle,
|
42
|
+
headingLevel,
|
43
|
+
headingSize,
|
32
44
|
href,
|
33
|
-
|
45
|
+
imageSrc,
|
46
|
+
imageAlt,
|
47
|
+
imageWidth,
|
48
|
+
imageHeight,
|
49
|
+
imageSources,
|
34
50
|
label,
|
35
51
|
body,
|
36
52
|
text,
|
@@ -43,9 +59,16 @@ const Template = ({
|
|
43
59
|
}) =>
|
44
60
|
Card({
|
45
61
|
params: {
|
46
|
-
|
62
|
+
title,
|
63
|
+
supertitle,
|
64
|
+
headingLevel,
|
65
|
+
headingSize,
|
47
66
|
href,
|
48
|
-
|
67
|
+
imageSrc,
|
68
|
+
imageAlt,
|
69
|
+
imageWidth,
|
70
|
+
imageHeight,
|
71
|
+
imageSources,
|
49
72
|
label,
|
50
73
|
body,
|
51
74
|
text,
|
@@ -60,72 +83,53 @@ const Template = ({
|
|
60
83
|
|
61
84
|
export const Standard = Template.bind({});
|
62
85
|
Standard.args = {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
size: "l",
|
68
|
-
singleSentence: false,
|
69
|
-
},
|
86
|
+
supertitle: "Card supertitle",
|
87
|
+
title: "Card title",
|
88
|
+
headingLevel: 3,
|
89
|
+
headingSize: "m",
|
70
90
|
href: "#",
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
},
|
91
|
+
imageSrc:
|
92
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
93
|
+
imageAlt: "The National Archives office",
|
94
|
+
imageWidth: 1996,
|
95
|
+
imageHeight: 1331,
|
77
96
|
label: "New",
|
78
97
|
body: "<p>Card body</p>",
|
79
|
-
// actions: [
|
80
|
-
// {
|
81
|
-
// text: "Card action",
|
82
|
-
// href: "#",
|
83
|
-
// title: "Go and do the action",
|
84
|
-
// },
|
85
|
-
// ],
|
86
98
|
htmlElement: "article",
|
87
99
|
classes: "tna-card--demo",
|
88
100
|
};
|
89
101
|
|
90
102
|
export const Boxed = Template.bind({});
|
91
103
|
Boxed.args = {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
size: "l",
|
97
|
-
singleSentence: false,
|
98
|
-
},
|
104
|
+
supertitle: "Card supertitle",
|
105
|
+
title: "Card title",
|
106
|
+
headingLevel: 3,
|
107
|
+
headingSize: "m",
|
99
108
|
href: "#",
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
},
|
109
|
+
imageSrc:
|
110
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
111
|
+
imageAlt: "The National Archives office",
|
112
|
+
imageWidth: 1996,
|
113
|
+
imageHeight: 1331,
|
106
114
|
label: "New",
|
107
115
|
body: "<p>Card body</p>",
|
108
|
-
style: "
|
116
|
+
style: "boxed",
|
109
117
|
htmlElement: "article",
|
110
118
|
classes: "tna-card--demo",
|
111
119
|
};
|
112
120
|
|
113
121
|
export const Accent = Template.bind({});
|
114
122
|
Accent.args = {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
size: "l",
|
120
|
-
singleSentence: false,
|
121
|
-
},
|
123
|
+
supertitle: "Card supertitle",
|
124
|
+
title: "Card title",
|
125
|
+
headingLevel: 3,
|
126
|
+
headingSize: "m",
|
122
127
|
href: "#",
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
},
|
128
|
+
imageSrc:
|
129
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
130
|
+
imageAlt: "The National Archives office",
|
131
|
+
imageWidth: 1996,
|
132
|
+
imageHeight: 1331,
|
129
133
|
label: "New",
|
130
134
|
body: "<p>Card body</p>",
|
131
135
|
style: "accent",
|
@@ -135,20 +139,41 @@ Accent.args = {
|
|
135
139
|
|
136
140
|
export const Horizontal = Template.bind({});
|
137
141
|
Horizontal.args = {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
142
|
+
supertitle: "Card supertitle",
|
143
|
+
title: "Card title",
|
144
|
+
headingLevel: 3,
|
145
|
+
headingSize: "l",
|
146
|
+
imageSrc:
|
147
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
148
|
+
imageAlt: "The National Archives office",
|
149
|
+
imageWidth: 1996,
|
150
|
+
imageHeight: 1331,
|
151
|
+
label: "New",
|
152
|
+
body: "<p>Card body</p>",
|
153
|
+
actions: [
|
154
|
+
{
|
155
|
+
text: "Card action",
|
156
|
+
href: "#",
|
157
|
+
title: "Go and do the action",
|
158
|
+
icon: "calendar",
|
159
|
+
},
|
160
|
+
],
|
161
|
+
horizontal: true,
|
162
|
+
htmlElement: "article",
|
163
|
+
classes: "tna-card--demo",
|
164
|
+
};
|
165
|
+
|
166
|
+
export const HorizontalBoxed = Template.bind({});
|
167
|
+
HorizontalBoxed.args = {
|
168
|
+
supertitle: "Card supertitle",
|
169
|
+
title: "Card title",
|
170
|
+
headingLevel: 3,
|
171
|
+
headingSize: "l",
|
172
|
+
imageSrc:
|
173
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
174
|
+
imageAlt: "The National Archives office",
|
175
|
+
imageWidth: 1996,
|
176
|
+
imageHeight: 1331,
|
152
177
|
label: "New",
|
153
178
|
body: "<p>Card body</p>",
|
154
179
|
actions: [
|
@@ -156,17 +181,85 @@ Horizontal.args = {
|
|
156
181
|
text: "Card action",
|
157
182
|
href: "#",
|
158
183
|
title: "Go and do the action",
|
184
|
+
icon: "calendar",
|
159
185
|
},
|
160
186
|
],
|
161
187
|
horizontal: true,
|
188
|
+
style: "boxed",
|
189
|
+
htmlElement: "article",
|
190
|
+
classes: "tna-card--demo",
|
191
|
+
};
|
192
|
+
|
193
|
+
export const HorizontalAccent = Template.bind({});
|
194
|
+
HorizontalAccent.args = {
|
195
|
+
supertitle: "Card supertitle",
|
196
|
+
title: "Card title",
|
197
|
+
headingLevel: 3,
|
198
|
+
headingSize: "l",
|
199
|
+
imageSrc:
|
200
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
201
|
+
imageAlt: "The National Archives office",
|
202
|
+
imageWidth: 1996,
|
203
|
+
imageHeight: 1331,
|
204
|
+
label: "New",
|
205
|
+
body: "<p>Card body</p>",
|
206
|
+
actions: [
|
207
|
+
{
|
208
|
+
text: "Card action",
|
209
|
+
href: "#",
|
210
|
+
title: "Go and do the action",
|
211
|
+
icon: "calendar",
|
212
|
+
},
|
213
|
+
],
|
214
|
+
horizontal: true,
|
215
|
+
style: "accent",
|
216
|
+
htmlElement: "article",
|
217
|
+
classes: "tna-card--demo",
|
218
|
+
};
|
219
|
+
|
220
|
+
export const Sources = Template.bind({});
|
221
|
+
Sources.args = {
|
222
|
+
supertitle: "Card supertitle",
|
223
|
+
title: "Card title",
|
224
|
+
headingLevel: 3,
|
225
|
+
headingSize: "m",
|
226
|
+
imageSrc: "https://www.gstatic.com/webp/gallery/2.jpg",
|
227
|
+
imageAlt: "A man in a canoe paddling through white water",
|
228
|
+
imageWidth: 550,
|
229
|
+
imageHeight: 404,
|
230
|
+
imageSources: [
|
231
|
+
{
|
232
|
+
imageSrc: "https://www.gstatic.com/webp/gallery/2.webp",
|
233
|
+
type: "image/webp",
|
234
|
+
},
|
235
|
+
],
|
236
|
+
body: "<p>Card body</p>",
|
237
|
+
htmlElement: "article",
|
238
|
+
classes: "tna-card--demo",
|
239
|
+
};
|
240
|
+
|
241
|
+
export const WithoutImage = Template.bind({});
|
242
|
+
WithoutImage.args = {
|
243
|
+
supertitle: "Card supertitle",
|
244
|
+
title: "Card title",
|
245
|
+
headingLevel: 3,
|
246
|
+
headingSize: "m",
|
247
|
+
body: "<p>Card body</p>",
|
162
248
|
htmlElement: "article",
|
163
249
|
classes: "tna-card--demo",
|
164
250
|
};
|
165
251
|
|
166
252
|
const GridTemplate = ({
|
167
|
-
|
253
|
+
title,
|
254
|
+
supertitle,
|
255
|
+
headingLevel,
|
256
|
+
headingSize,
|
168
257
|
href,
|
169
|
-
|
258
|
+
imageSrc,
|
259
|
+
imageAlt,
|
260
|
+
imageWidth,
|
261
|
+
imageHeight,
|
262
|
+
imageSources,
|
170
263
|
label,
|
171
264
|
body,
|
172
265
|
text,
|
@@ -179,12 +272,19 @@ const GridTemplate = ({
|
|
179
272
|
`<div class="tna-container">
|
180
273
|
${Array(12)
|
181
274
|
.fill(
|
182
|
-
`<div class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny tna-!--margin-bottom-
|
275
|
+
`<div class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny tna-!--margin-bottom-m">
|
183
276
|
${Card({
|
184
277
|
params: {
|
185
|
-
|
278
|
+
title,
|
279
|
+
supertitle,
|
280
|
+
headingLevel,
|
281
|
+
headingSize,
|
186
282
|
href,
|
187
|
-
|
283
|
+
imageSrc,
|
284
|
+
imageAlt,
|
285
|
+
imageWidth,
|
286
|
+
imageHeight,
|
287
|
+
imageSources,
|
188
288
|
label,
|
189
289
|
body,
|
190
290
|
text,
|
@@ -202,28 +302,18 @@ const GridTemplate = ({
|
|
202
302
|
|
203
303
|
export const Grid = GridTemplate.bind({});
|
204
304
|
Grid.args = {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
singleSentence: false,
|
210
|
-
},
|
305
|
+
supertitle: "Card supertitle",
|
306
|
+
title: "Card title",
|
307
|
+
headingLevel: 3,
|
308
|
+
headingSize: "m",
|
211
309
|
href: "#",
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
},
|
310
|
+
imageSrc:
|
311
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
312
|
+
imageAlt: "The National Archives office",
|
313
|
+
imageWidth: 1996,
|
314
|
+
imageHeight: 1331,
|
218
315
|
label: "New",
|
219
316
|
body: "<p>Card body</p>",
|
220
|
-
// actions: [
|
221
|
-
// {
|
222
|
-
// text: "Card action",
|
223
|
-
// href: "#",
|
224
|
-
// title: "Go and do the action",
|
225
|
-
// },
|
226
|
-
// ],
|
227
317
|
htmlElement: "article",
|
228
318
|
classes: "tna-card--demo",
|
229
319
|
};
|