@nationalarchives/frontend 0.1.20-prerelease → 0.1.22-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 +7 -2
- 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.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +5 -15
- package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +12 -4
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +64 -0
- package/nationalarchives/components/breadcrumbs/fixtures.json +2 -2
- package/nationalarchives/components/breadcrumbs/template.njk +11 -15
- package/nationalarchives/components/button/_button-group.scss +1 -1
- package/nationalarchives/components/button/button.css +1 -13
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +24 -6
- package/nationalarchives/components/card/card.css +1 -13
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +52 -7
- package/nationalarchives/components/card/card.stories.js +78 -36
- package/nationalarchives/components/card/fixtures.json +40 -16
- package/nationalarchives/components/card/macro-options.json +26 -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 +2 -2
- 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 +8 -55
- package/nationalarchives/components/footer/footer.stories.js +1 -1
- package/nationalarchives/components/footer/template.njk +16 -14
- package/nationalarchives/components/gallery/gallery.css +1 -13
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/gallery/template.njk +2 -2
- 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/grid/grid.stories.js +21 -0
- package/nationalarchives/components/grid/macro-options.json +48 -0
- package/nationalarchives/components/grid/template.njk +29 -3
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.scss +60 -145
- package/nationalarchives/components/header/header.stories.js +2 -0
- package/nationalarchives/components/header/macro-options.json +12 -0
- package/nationalarchives/components/header/template.njk +6 -1
- package/nationalarchives/components/hero/fixtures.json +166 -6
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +187 -64
- package/nationalarchives/components/hero/hero.stories.js +98 -23
- package/nationalarchives/components/hero/macro-options.json +48 -12
- package/nationalarchives/components/hero/template.njk +34 -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 +2 -2
- package/nationalarchives/components/message/message.css +1 -1
- package/nationalarchives/components/message/message.css.map +1 -1
- package/nationalarchives/components/message/message.scss +4 -0
- 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 +98 -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/phase-banner/phase-banner.scss +5 -1
- package/nationalarchives/components/picture/picture.css +1 -13
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/picture/picture.scss +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/profile/template.njk +2 -2
- 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 +17 -2
- package/nationalarchives/components/tabs/tabs.stories.js +6 -6
- 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 +333 -72
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +10 -21
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +2 -2
- package/nationalarchives/stories/utilities/typography/headings.stories.js +6 -3
- 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 +31 -14
- package/nationalarchives/templates/layouts/_prototype-kit.njk +11 -0
- package/nationalarchives/templates/search-results.njk +11 -15
- package/nationalarchives/templates/topics.njk +18 -22
- package/nationalarchives/tools/_colour.scss +77 -23
- package/nationalarchives/tools/_grid.scss +12 -12
- package/nationalarchives/tools/_media.scss +6 -0
- package/nationalarchives/tools/_spacing.scss +6 -6
- package/nationalarchives/tools/_typography.scss +4 -2
- package/nationalarchives/utilities/_a11y.scss +15 -0
- package/nationalarchives/utilities/_columns.scss +42 -0
- package/nationalarchives/utilities/_debug.scss +1 -1
- package/nationalarchives/utilities/_global.scss +32 -32
- package/nationalarchives/utilities/_index.scss +2 -0
- package/nationalarchives/utilities/_lists.scss +181 -0
- package/nationalarchives/utilities/_typography.scss +129 -138
- package/nationalarchives/variables/_assets.scss +2 -1
- package/nationalarchives/variables/_colour.scss +94 -74
- 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 +15 -14
- 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/design/about.mdx +0 -25
- package/nationalarchives/stories/development/relationships.mdx +0 -57
- package/nationalarchives/stories/development/using.mdx +0 -75
@@ -7,7 +7,7 @@
|
|
7
7
|
@use "../button";
|
8
8
|
|
9
9
|
.tna-card {
|
10
|
-
@include spacing.space-
|
10
|
+
@include spacing.space-above;
|
11
11
|
|
12
12
|
&__inner {
|
13
13
|
display: flex;
|
@@ -58,6 +58,32 @@
|
|
58
58
|
order: 3;
|
59
59
|
}
|
60
60
|
|
61
|
+
&__meta {
|
62
|
+
margin-bottom: 1rem;
|
63
|
+
padding: 0;
|
64
|
+
|
65
|
+
display: flex;
|
66
|
+
flex-wrap: wrap;
|
67
|
+
gap: 0.5rem 1.5rem;
|
68
|
+
|
69
|
+
line-height: 1.3;
|
70
|
+
|
71
|
+
list-style: none;
|
72
|
+
|
73
|
+
&-item {
|
74
|
+
display: flex;
|
75
|
+
align-items: center;
|
76
|
+
|
77
|
+
@include typography.detail-font-small;
|
78
|
+
|
79
|
+
.fa-solid {
|
80
|
+
margin-right: 0.75rem;
|
81
|
+
|
82
|
+
@include colour.colour-font("icon-light");
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
61
87
|
&__actions {
|
62
88
|
margin-top: 2rem;
|
63
89
|
|
@@ -67,8 +93,6 @@
|
|
67
93
|
&__action {
|
68
94
|
@include typography.main-font-weight-bold;
|
69
95
|
|
70
|
-
.fa,
|
71
|
-
.fa-regular,
|
72
96
|
.fa-solid,
|
73
97
|
.fa-brands {
|
74
98
|
margin-right: 0.5rem;
|
@@ -98,6 +122,8 @@
|
|
98
122
|
|
99
123
|
.tna-hgroup__supertitle {
|
100
124
|
@include colour.invert;
|
125
|
+
|
126
|
+
@include colour.colour-border("contrast-background");
|
101
127
|
}
|
102
128
|
}
|
103
129
|
|
@@ -134,18 +160,18 @@
|
|
134
160
|
&--horizontal#{&}--accent {
|
135
161
|
@include media.on-mobile {
|
136
162
|
.tna-card__inner {
|
137
|
-
padding: 0 0
|
163
|
+
padding: 0 0 1rem;
|
138
164
|
}
|
139
165
|
|
140
166
|
.tna-card__image-container {
|
141
|
-
margin-bottom:
|
167
|
+
margin-bottom: 1rem;
|
142
168
|
}
|
143
169
|
|
144
170
|
.tna-card__heading,
|
145
171
|
.tna-card__body,
|
146
172
|
.tna-card__actions {
|
147
|
-
margin-right:
|
148
|
-
margin-left:
|
173
|
+
margin-right: 1rem;
|
174
|
+
margin-left: 1rem;
|
149
175
|
}
|
150
176
|
}
|
151
177
|
}
|
@@ -167,5 +193,24 @@
|
|
167
193
|
|
168
194
|
@include colour.on-high-contrast {
|
169
195
|
@include colour.colour-border("keyline-dark", 1px);
|
196
|
+
|
197
|
+
&__meta {
|
198
|
+
&-item {
|
199
|
+
padding-right: 0.5rem;
|
200
|
+
|
201
|
+
@include colour.colour-border("keyline-dark", 1px, solid);
|
202
|
+
|
203
|
+
.fa-solid {
|
204
|
+
margin-right: 0.5rem;
|
205
|
+
padding: 0.5rem;
|
206
|
+
|
207
|
+
@include colour.colour-font("contrast-font-base");
|
208
|
+
|
209
|
+
@include colour.colour-background("contrast-background");
|
210
|
+
|
211
|
+
@include colour.colour-border("keyline-dark", 1px, solid, right);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
170
215
|
}
|
171
216
|
}
|
@@ -2,17 +2,19 @@ import Card from "./template.njk";
|
|
2
2
|
import macroOptions from "./macro-options.json";
|
3
3
|
|
4
4
|
const argTypes = {
|
5
|
-
title: { control: "text" },
|
6
5
|
supertitle: { control: "text" },
|
6
|
+
title: { control: "text" },
|
7
7
|
headingLevel: { control: { type: "number", min: 1, max: 6 } },
|
8
|
-
headingSize: { control: "inline-radio", options: ["m", "l"] },
|
8
|
+
headingSize: { control: "inline-radio", options: ["s", "m", "l"] },
|
9
9
|
href: { control: "text" },
|
10
10
|
imageSrc: { control: { type: "file", accept: ".jpg" } },
|
11
11
|
imageAlt: { control: "text" },
|
12
12
|
imageWidth: { control: { type: "number", min: 1 } },
|
13
13
|
imageHeight: { control: { type: "number", min: 1 } },
|
14
|
+
imageType: { control: "text" },
|
14
15
|
imageSources: { control: "object" },
|
15
16
|
label: { control: "text" },
|
17
|
+
meta: { control: "object" },
|
16
18
|
body: { control: "text" },
|
17
19
|
text: { control: "text" },
|
18
20
|
actions: { control: "object" },
|
@@ -37,8 +39,8 @@ export default {
|
|
37
39
|
};
|
38
40
|
|
39
41
|
const Template = ({
|
40
|
-
title,
|
41
42
|
supertitle,
|
43
|
+
title,
|
42
44
|
headingLevel,
|
43
45
|
headingSize,
|
44
46
|
href,
|
@@ -46,8 +48,10 @@ const Template = ({
|
|
46
48
|
imageAlt,
|
47
49
|
imageWidth,
|
48
50
|
imageHeight,
|
51
|
+
imageType,
|
49
52
|
imageSources,
|
50
53
|
label,
|
54
|
+
meta,
|
51
55
|
body,
|
52
56
|
text,
|
53
57
|
actions,
|
@@ -59,8 +63,8 @@ const Template = ({
|
|
59
63
|
}) =>
|
60
64
|
Card({
|
61
65
|
params: {
|
62
|
-
title,
|
63
66
|
supertitle,
|
67
|
+
title,
|
64
68
|
headingLevel,
|
65
69
|
headingSize,
|
66
70
|
href,
|
@@ -68,8 +72,10 @@ const Template = ({
|
|
68
72
|
imageAlt,
|
69
73
|
imageWidth,
|
70
74
|
imageHeight,
|
75
|
+
imageType,
|
71
76
|
imageSources,
|
72
77
|
label,
|
78
|
+
meta,
|
73
79
|
body,
|
74
80
|
text,
|
75
81
|
actions,
|
@@ -86,15 +92,53 @@ Standard.args = {
|
|
86
92
|
supertitle: "Card supertitle",
|
87
93
|
title: "Card title",
|
88
94
|
headingLevel: 3,
|
89
|
-
headingSize: "
|
95
|
+
headingSize: "s",
|
96
|
+
href: "#",
|
97
|
+
imageSrc:
|
98
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
99
|
+
imageAlt: "The National Archives office",
|
100
|
+
imageWidth: 499,
|
101
|
+
imageHeight: 333,
|
102
|
+
label: "New",
|
103
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
104
|
+
htmlElement: "article",
|
105
|
+
classes: "tna-card--demo",
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Simple = Template.bind({});
|
109
|
+
Simple.args = {
|
110
|
+
title: "Card title",
|
111
|
+
headingLevel: 3,
|
112
|
+
headingSize: "s",
|
113
|
+
imageSrc:
|
114
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
115
|
+
imageAlt: "The National Archives office",
|
116
|
+
imageWidth: 499,
|
117
|
+
imageHeight: 333,
|
118
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
119
|
+
htmlElement: "article",
|
120
|
+
classes: "tna-card--demo",
|
121
|
+
};
|
122
|
+
|
123
|
+
export const Meta = Template.bind({});
|
124
|
+
Meta.args = {
|
125
|
+
supertitle: "Card supertitle",
|
126
|
+
title: "Card title",
|
127
|
+
headingLevel: 3,
|
128
|
+
headingSize: "s",
|
90
129
|
href: "#",
|
91
130
|
imageSrc:
|
92
131
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
93
132
|
imageAlt: "The National Archives office",
|
94
|
-
imageWidth:
|
95
|
-
imageHeight:
|
133
|
+
imageWidth: 499,
|
134
|
+
imageHeight: 333,
|
96
135
|
label: "New",
|
97
|
-
|
136
|
+
meta: [
|
137
|
+
{ text: "24th September 2023", icon: "calendar" },
|
138
|
+
{ text: "From £16", icon: "ticket" },
|
139
|
+
{ text: "Online", icon: "location-dot" },
|
140
|
+
],
|
141
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
98
142
|
htmlElement: "article",
|
99
143
|
classes: "tna-card--demo",
|
100
144
|
};
|
@@ -104,15 +148,15 @@ Boxed.args = {
|
|
104
148
|
supertitle: "Card supertitle",
|
105
149
|
title: "Card title",
|
106
150
|
headingLevel: 3,
|
107
|
-
headingSize: "
|
151
|
+
headingSize: "s",
|
108
152
|
href: "#",
|
109
153
|
imageSrc:
|
110
154
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
111
155
|
imageAlt: "The National Archives office",
|
112
|
-
imageWidth:
|
113
|
-
imageHeight:
|
156
|
+
imageWidth: 499,
|
157
|
+
imageHeight: 333,
|
114
158
|
label: "New",
|
115
|
-
body: "<p>
|
159
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
116
160
|
style: "boxed",
|
117
161
|
htmlElement: "article",
|
118
162
|
classes: "tna-card--demo",
|
@@ -123,15 +167,15 @@ Accent.args = {
|
|
123
167
|
supertitle: "Card supertitle",
|
124
168
|
title: "Card title",
|
125
169
|
headingLevel: 3,
|
126
|
-
headingSize: "
|
170
|
+
headingSize: "s",
|
127
171
|
href: "#",
|
128
172
|
imageSrc:
|
129
173
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
130
174
|
imageAlt: "The National Archives office",
|
131
|
-
imageWidth:
|
132
|
-
imageHeight:
|
175
|
+
imageWidth: 499,
|
176
|
+
imageHeight: 333,
|
133
177
|
label: "New",
|
134
|
-
body: "<p>
|
178
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
135
179
|
style: "accent",
|
136
180
|
htmlElement: "article",
|
137
181
|
classes: "tna-card--demo",
|
@@ -146,10 +190,10 @@ Horizontal.args = {
|
|
146
190
|
imageSrc:
|
147
191
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
148
192
|
imageAlt: "The National Archives office",
|
149
|
-
imageWidth:
|
150
|
-
imageHeight:
|
193
|
+
imageWidth: 499,
|
194
|
+
imageHeight: 333,
|
151
195
|
label: "New",
|
152
|
-
body: "<p>
|
196
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
153
197
|
actions: [
|
154
198
|
{
|
155
199
|
text: "Card action",
|
@@ -172,10 +216,10 @@ HorizontalBoxed.args = {
|
|
172
216
|
imageSrc:
|
173
217
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
174
218
|
imageAlt: "The National Archives office",
|
175
|
-
imageWidth:
|
176
|
-
imageHeight:
|
219
|
+
imageWidth: 499,
|
220
|
+
imageHeight: 333,
|
177
221
|
label: "New",
|
178
|
-
body: "<p>
|
222
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
179
223
|
actions: [
|
180
224
|
{
|
181
225
|
text: "Card action",
|
@@ -199,10 +243,10 @@ HorizontalAccent.args = {
|
|
199
243
|
imageSrc:
|
200
244
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
201
245
|
imageAlt: "The National Archives office",
|
202
|
-
imageWidth:
|
203
|
-
imageHeight:
|
246
|
+
imageWidth: 499,
|
247
|
+
imageHeight: 333,
|
204
248
|
label: "New",
|
205
|
-
body: "<p>
|
249
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
206
250
|
actions: [
|
207
251
|
{
|
208
252
|
text: "Card action",
|
@@ -222,18 +266,18 @@ Sources.args = {
|
|
222
266
|
supertitle: "Card supertitle",
|
223
267
|
title: "Card title",
|
224
268
|
headingLevel: 3,
|
225
|
-
headingSize: "
|
269
|
+
headingSize: "s",
|
226
270
|
imageSrc: "https://www.gstatic.com/webp/gallery/2.jpg",
|
227
271
|
imageAlt: "A man in a canoe paddling through white water",
|
228
272
|
imageWidth: 550,
|
229
273
|
imageHeight: 404,
|
230
274
|
imageSources: [
|
231
275
|
{
|
232
|
-
|
276
|
+
src: "https://www.gstatic.com/webp/gallery/2.webp",
|
233
277
|
type: "image/webp",
|
234
278
|
},
|
235
279
|
],
|
236
|
-
body: "<p>
|
280
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
237
281
|
htmlElement: "article",
|
238
282
|
classes: "tna-card--demo",
|
239
283
|
};
|
@@ -243,8 +287,8 @@ WithoutImage.args = {
|
|
243
287
|
supertitle: "Card supertitle",
|
244
288
|
title: "Card title",
|
245
289
|
headingLevel: 3,
|
246
|
-
headingSize: "
|
247
|
-
body: "<p>
|
290
|
+
headingSize: "s",
|
291
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
248
292
|
htmlElement: "article",
|
249
293
|
classes: "tna-card--demo",
|
250
294
|
};
|
@@ -302,18 +346,16 @@ const GridTemplate = ({
|
|
302
346
|
|
303
347
|
export const Grid = GridTemplate.bind({});
|
304
348
|
Grid.args = {
|
305
|
-
supertitle: "Card supertitle",
|
306
349
|
title: "Card title",
|
307
350
|
headingLevel: 3,
|
308
|
-
headingSize: "
|
351
|
+
headingSize: "s",
|
309
352
|
href: "#",
|
310
353
|
imageSrc:
|
311
354
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
312
355
|
imageAlt: "The National Archives office",
|
313
|
-
imageWidth:
|
314
|
-
imageHeight:
|
315
|
-
|
316
|
-
body: "<p>Card body</p>",
|
356
|
+
imageWidth: 499,
|
357
|
+
imageHeight: 333,
|
358
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
317
359
|
htmlElement: "article",
|
318
360
|
classes: "tna-card--demo",
|
319
361
|
};
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"headingLevel": 3,
|
9
9
|
"body": "<p>Card body</p>"
|
10
10
|
},
|
11
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
11
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
12
12
|
"hidden": false
|
13
13
|
},
|
14
14
|
{
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"headingLevel": 3,
|
20
20
|
"body": "<p>Card body</p>"
|
21
21
|
},
|
22
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-hgroup
|
22
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-hgroup-s tna-card__heading\"><h3 class=\"tna-hgroup__title\"><span class=\"tna-hgroup__supertitle\">Card supertitle</span>Card title</h3></hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
23
23
|
"hidden": false
|
24
24
|
},
|
25
25
|
{
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"headingSize": "xl",
|
31
31
|
"body": "<p>Card body</p>"
|
32
32
|
},
|
33
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
33
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-xl tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
34
34
|
"hidden": false
|
35
35
|
},
|
36
36
|
{
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"headingLevel": 1,
|
41
41
|
"body": "<p>Card body</p>"
|
42
42
|
},
|
43
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h1 class=\" tna-heading
|
43
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h1 class=\" tna-heading-s tna-card__heading\">Card title</h1><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
44
44
|
"hidden": false
|
45
45
|
},
|
46
46
|
{
|
@@ -51,7 +51,31 @@
|
|
51
51
|
"href": "#",
|
52
52
|
"body": "<p>Card body</p>"
|
53
53
|
},
|
54
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
54
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\"><a href=\"#\" class=\"tna-card__heading-link\">Card title</a></h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
55
|
+
"hidden": false
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"name": "with meta",
|
59
|
+
"options": {
|
60
|
+
"title": "Card title",
|
61
|
+
"headingLevel": 3,
|
62
|
+
"meta": [
|
63
|
+
{
|
64
|
+
"text": "24th September 2023",
|
65
|
+
"icon": "calendar"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"text": "From £16",
|
69
|
+
"icon": "ticket"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"text": "Online",
|
73
|
+
"icon": "location-dot"
|
74
|
+
}
|
75
|
+
],
|
76
|
+
"body": "<p>Card body</p>"
|
77
|
+
},
|
78
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><ul class=\"tna-card__meta\"><li class=\"tna-card__meta-item\"><i class=\"fa-solid fa-calendar\"></i>24th September 2023</li><li class=\"tna-card__meta-item\"><i class=\"fa-solid fa-ticket\"></i>From £16</li><li class=\"tna-card__meta-item\"><i class=\"fa-solid fa-location-dot\"></i>Online</li></ul><p>Card body</p></div></div></div>",
|
55
79
|
"hidden": false
|
56
80
|
},
|
57
81
|
{
|
@@ -61,7 +85,7 @@
|
|
61
85
|
"headingLevel": 3,
|
62
86
|
"text": "Card body"
|
63
87
|
},
|
64
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
88
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
65
89
|
"hidden": false
|
66
90
|
},
|
67
91
|
{
|
@@ -75,7 +99,7 @@
|
|
75
99
|
"imageHeight": 360,
|
76
100
|
"body": "<p>Card body</p>"
|
77
101
|
},
|
78
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
102
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__image-container\"><picture class=\"tna-card__image\"><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" width=\"640\" height=\"360\"></picture></div><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
79
103
|
"hidden": false
|
80
104
|
},
|
81
105
|
{
|
@@ -95,7 +119,7 @@
|
|
95
119
|
],
|
96
120
|
"body": "<p>Card body</p>"
|
97
121
|
},
|
98
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
122
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__image-container\"><picture class=\"tna-card__image\"><source srcset=\"https://www.gstatic.com/webp/gallery/2.webp\" type=\"image/webp\" width=\"640\" height=\"360\"><source srcset=\"https://loremflickr.com/640/360\" type=\"image/jpeg\" width=\"640\" height=\"360\"><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" width=\"640\" height=\"360\"></picture></div><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
99
123
|
"hidden": false
|
100
124
|
},
|
101
125
|
{
|
@@ -110,7 +134,7 @@
|
|
110
134
|
"href": "#",
|
111
135
|
"body": "<p>Card body</p>"
|
112
136
|
},
|
113
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
137
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\"><a href=\"#\" class=\"tna-card__heading-link\">Card title</a></h3><a href=\"#\" class=\"tna-card__image-container\" tabindex=\"-1\"><picture class=\"tna-card__image\"><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" width=\"640\" height=\"360\"></picture></a><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
114
138
|
"hidden": false
|
115
139
|
},
|
116
140
|
{
|
@@ -127,7 +151,7 @@
|
|
127
151
|
}
|
128
152
|
]
|
129
153
|
},
|
130
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
154
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div><div class=\"tna-card__actions\"><a href=\"#\" class=\"tna-card__action\" role=\"button\"title=\"Go and do the action\">Card action</a></div></div></div>",
|
131
155
|
"hidden": false
|
132
156
|
},
|
133
157
|
{
|
@@ -138,7 +162,7 @@
|
|
138
162
|
"label": "New",
|
139
163
|
"body": "<p>Card body</p>"
|
140
164
|
},
|
141
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
165
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
142
166
|
"hidden": false
|
143
167
|
},
|
144
168
|
{
|
@@ -149,7 +173,7 @@
|
|
149
173
|
"body": "<p>Card body</p>",
|
150
174
|
"style": "boxed"
|
151
175
|
},
|
152
|
-
"html": "<div class=\"tna-card tna-card--contrast\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
176
|
+
"html": "<div class=\"tna-card tna-card--contrast\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
153
177
|
"hidden": false
|
154
178
|
},
|
155
179
|
{
|
@@ -160,7 +184,7 @@
|
|
160
184
|
"body": "<p>Card body</p>",
|
161
185
|
"style": "accent"
|
162
186
|
},
|
163
|
-
"html": "<div class=\"tna-card tna-card--accent\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
187
|
+
"html": "<div class=\"tna-card tna-card--accent\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
164
188
|
"hidden": false
|
165
189
|
},
|
166
190
|
{
|
@@ -171,7 +195,7 @@
|
|
171
195
|
"body": "<p>Card body</p>",
|
172
196
|
"style": "foobar"
|
173
197
|
},
|
174
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
198
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
175
199
|
"hidden": false
|
176
200
|
},
|
177
201
|
{
|
@@ -182,7 +206,7 @@
|
|
182
206
|
"body": "<p>Card body</p>",
|
183
207
|
"classes": "card__test-class"
|
184
208
|
},
|
185
|
-
"html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
209
|
+
"html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
186
210
|
"hidden": false
|
187
211
|
},
|
188
212
|
{
|
@@ -195,7 +219,7 @@
|
|
195
219
|
"data-testattribute": "foobar"
|
196
220
|
}
|
197
221
|
},
|
198
|
-
"html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading
|
222
|
+
"html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading-s tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
|
199
223
|
"hidden": false
|
200
224
|
}
|
201
225
|
]
|
@@ -54,6 +54,12 @@
|
|
54
54
|
"required": false,
|
55
55
|
"description": "The height of the image in pixels."
|
56
56
|
},
|
57
|
+
{
|
58
|
+
"name": "imageType",
|
59
|
+
"type": "string",
|
60
|
+
"required": false,
|
61
|
+
"description": ""
|
62
|
+
},
|
57
63
|
{
|
58
64
|
"name": "imageSources",
|
59
65
|
"type": "array",
|
@@ -98,6 +104,26 @@
|
|
98
104
|
"required": false,
|
99
105
|
"description": "A label which will appear over the top left of the card's image. If there is no imagem, the label is not displayed."
|
100
106
|
},
|
107
|
+
{
|
108
|
+
"name": "meta",
|
109
|
+
"type": "array",
|
110
|
+
"required": false,
|
111
|
+
"description": "Small pieces of additional information akin to subtitles, displayed between the title and the body.",
|
112
|
+
"params": [
|
113
|
+
{
|
114
|
+
"name": "text",
|
115
|
+
"type": "string",
|
116
|
+
"required": true,
|
117
|
+
"description": "The text element of the meta data."
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"name": "icon",
|
121
|
+
"type": "string",
|
122
|
+
"required": false,
|
123
|
+
"description": "The name of a font-awesome icon, without the prefixed `fa-`."
|
124
|
+
}
|
125
|
+
]
|
126
|
+
},
|
101
127
|
{
|
102
128
|
"name": "body",
|
103
129
|
"type": "string",
|