@nationalarchives/frontend 0.1.20-prerelease → 0.1.21-prerelease

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/govuk-prototype-kit.config.json +6 -1
  3. package/nationalarchives/_prototype-kit.scss +16 -0
  4. package/nationalarchives/all.css +3 -3
  5. package/nationalarchives/all.css.map +1 -1
  6. package/nationalarchives/all.js +1 -1
  7. package/nationalarchives/all.js.map +1 -1
  8. package/nationalarchives/all.mjs +17 -10
  9. package/nationalarchives/all.scss +1 -5
  10. package/nationalarchives/assets/images/favicon.ico +0 -0
  11. package/nationalarchives/assets/images/mask-icon.svg +17 -5
  12. package/nationalarchives/assets/images/mstile-150x150.png +0 -0
  13. package/nationalarchives/components/_index.scss +1 -0
  14. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +10 -0
  17. package/nationalarchives/components/button/button.css +1 -13
  18. package/nationalarchives/components/button/button.css.map +1 -1
  19. package/nationalarchives/components/button/button.scss +23 -6
  20. package/nationalarchives/components/card/card.css +1 -13
  21. package/nationalarchives/components/card/card.css.map +1 -1
  22. package/nationalarchives/components/card/card.scss +51 -6
  23. package/nationalarchives/components/card/card.stories.js +74 -35
  24. package/nationalarchives/components/card/fixtures.json +39 -15
  25. package/nationalarchives/components/card/macro-options.json +20 -0
  26. package/nationalarchives/components/card/template.njk +38 -26
  27. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -13
  28. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  29. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  30. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  31. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +15 -7
  32. package/nationalarchives/components/cookie-banner/cookie-banner.scss +9 -1
  33. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +23 -10
  34. package/nationalarchives/components/cookie-banner/macro-options.json +1 -1
  35. package/nationalarchives/components/cookie-banner/template.njk +4 -4
  36. package/nationalarchives/components/filters/filters.css +1 -1
  37. package/nationalarchives/components/filters/filters.css.map +1 -1
  38. package/nationalarchives/components/filters/filters.scss +1 -1
  39. package/nationalarchives/components/footer/fixtures.json +1 -1
  40. package/nationalarchives/components/footer/footer.css +1 -13
  41. package/nationalarchives/components/footer/footer.css.map +1 -1
  42. package/nationalarchives/components/footer/footer.scss +2 -8
  43. package/nationalarchives/components/footer/template.njk +8 -7
  44. package/nationalarchives/components/gallery/gallery.css +1 -13
  45. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  46. package/nationalarchives/components/grid/grid.css +1 -1
  47. package/nationalarchives/components/grid/grid.css.map +1 -1
  48. package/nationalarchives/components/grid/grid.scss +15 -11
  49. package/nationalarchives/components/header/header.css +1 -1
  50. package/nationalarchives/components/header/header.css.map +1 -1
  51. package/nationalarchives/components/header/header.scss +10 -24
  52. package/nationalarchives/components/hero/fixtures.json +85 -6
  53. package/nationalarchives/components/hero/hero.css +1 -1
  54. package/nationalarchives/components/hero/hero.css.map +1 -1
  55. package/nationalarchives/components/hero/hero.scss +177 -63
  56. package/nationalarchives/components/hero/hero.stories.js +74 -23
  57. package/nationalarchives/components/hero/macro-options.json +28 -36
  58. package/nationalarchives/components/hero/template.njk +26 -24
  59. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  60. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  61. package/nationalarchives/components/index-grid/template.njk +1 -1
  62. package/nationalarchives/components/message/message.css +1 -1
  63. package/nationalarchives/components/message/message.css.map +1 -1
  64. package/nationalarchives/components/pagination/_index.scss +1 -0
  65. package/nationalarchives/components/pagination/fixtures.json +4 -0
  66. package/nationalarchives/components/pagination/macro-options.json +116 -0
  67. package/nationalarchives/components/pagination/macro.njk +3 -0
  68. package/nationalarchives/components/pagination/pagination.css +1 -0
  69. package/nationalarchives/components/pagination/pagination.css.map +1 -0
  70. package/nationalarchives/components/pagination/pagination.scss +79 -0
  71. package/nationalarchives/components/pagination/pagination.stories.js +73 -0
  72. package/nationalarchives/components/pagination/template.njk +38 -0
  73. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  74. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  75. package/nationalarchives/components/picture/picture.css +1 -13
  76. package/nationalarchives/components/picture/picture.css.map +1 -1
  77. package/nationalarchives/components/picture/picture.stories.js +2 -2
  78. package/nationalarchives/components/profile/profile.css +1 -1
  79. package/nationalarchives/components/profile/profile.css.map +1 -1
  80. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  81. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  82. package/nationalarchives/components/skip-link/fixtures.json +1 -1
  83. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  84. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  85. package/nationalarchives/components/skip-link/skip-link.js +2 -0
  86. package/nationalarchives/components/skip-link/skip-link.js.map +1 -0
  87. package/nationalarchives/components/skip-link/skip-link.mjs +40 -0
  88. package/nationalarchives/components/skip-link/skip-link.scss +18 -16
  89. package/nationalarchives/components/skip-link/skip-link.stories.js +48 -6
  90. package/nationalarchives/components/skip-link/template.njk +1 -1
  91. package/nationalarchives/components/tabs/tabs.css +1 -1
  92. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  93. package/nationalarchives/components/tabs/tabs.js +1 -1
  94. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  95. package/nationalarchives/components/tabs/tabs.mjs +6 -2
  96. package/nationalarchives/components/tabs/tabs.scss +16 -1
  97. package/nationalarchives/lib/_font-awesome.scss +3 -2
  98. package/nationalarchives/lib/cookies.mjs +122 -50
  99. package/nationalarchives/stories/development/contributing.mdx +0 -10
  100. package/nationalarchives/stories/development/cookies.mdx +82 -0
  101. package/nationalarchives/stories/development/structure.mdx +88 -0
  102. package/nationalarchives/stories/development/using/compiled.mdx +9 -0
  103. package/nationalarchives/stories/development/using/hosted.mdx +53 -0
  104. package/nationalarchives/stories/development/using/npm.mdx +59 -0
  105. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +284 -29
  106. package/nationalarchives/stories/utilities/typography/headings.stories.js +4 -1
  107. package/nationalarchives/stories/utilities/typography/lists.stories.js +93 -0
  108. package/nationalarchives/stories/utilities/typography/typography.mdx +11 -1
  109. package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
  110. package/nationalarchives/templates/homepage.njk +11 -58
  111. package/nationalarchives/templates/layouts/_generic.njk +33 -14
  112. package/nationalarchives/templates/layouts/_prototype-kit.njk +11 -1
  113. package/nationalarchives/templates/search-results.njk +10 -14
  114. package/nationalarchives/templates/topics.njk +18 -22
  115. package/nationalarchives/tools/_colour.scss +42 -18
  116. package/nationalarchives/tools/_media.scss +6 -0
  117. package/nationalarchives/tools/_typography.scss +4 -2
  118. package/nationalarchives/utilities/_a11y.scss +15 -0
  119. package/nationalarchives/utilities/_debug.scss +1 -1
  120. package/nationalarchives/utilities/_global.scss +23 -25
  121. package/nationalarchives/utilities/_typography.scss +204 -27
  122. package/nationalarchives/variables/_assets.scss +2 -1
  123. package/nationalarchives/variables/_colour.scss +94 -73
  124. package/nationalarchives/variables/_features.scss +1 -0
  125. package/nationalarchives/variables/_grid.scss +5 -5
  126. package/nationalarchives/variables/_index.scss +1 -0
  127. package/nationalarchives/variables/_media.scss +29 -29
  128. package/nationalarchives/variables/_typography.scss +15 -12
  129. package/package.json +1 -1
  130. package/nationalarchives/_features.scss +0 -1
  131. package/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg +0 -51
  132. package/nationalarchives/assets/images/tna-horizontal-logo.svg +0 -51
  133. package/nationalarchives/stories/development/relationships.mdx +0 -57
  134. package/nationalarchives/stories/development/using.mdx +0 -75
@@ -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 2rem;
163
+ padding: 0 0 1rem;
138
164
  }
139
165
 
140
166
  .tna-card__image-container {
141
- margin-bottom: 2rem;
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: 2rem;
148
- margin-left: 2rem;
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,10 +2,10 @@ 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" },
@@ -13,6 +13,7 @@ const argTypes = {
13
13
  imageHeight: { control: { type: "number", min: 1 } },
14
14
  imageSources: { control: "object" },
15
15
  label: { control: "text" },
16
+ meta: { control: "object" },
16
17
  body: { control: "text" },
17
18
  text: { control: "text" },
18
19
  actions: { control: "object" },
@@ -37,8 +38,8 @@ export default {
37
38
  };
38
39
 
39
40
  const Template = ({
40
- title,
41
41
  supertitle,
42
+ title,
42
43
  headingLevel,
43
44
  headingSize,
44
45
  href,
@@ -48,6 +49,7 @@ const Template = ({
48
49
  imageHeight,
49
50
  imageSources,
50
51
  label,
52
+ meta,
51
53
  body,
52
54
  text,
53
55
  actions,
@@ -59,8 +61,8 @@ const Template = ({
59
61
  }) =>
60
62
  Card({
61
63
  params: {
62
- title,
63
64
  supertitle,
65
+ title,
64
66
  headingLevel,
65
67
  headingSize,
66
68
  href,
@@ -70,6 +72,7 @@ const Template = ({
70
72
  imageHeight,
71
73
  imageSources,
72
74
  label,
75
+ meta,
73
76
  body,
74
77
  text,
75
78
  actions,
@@ -86,15 +89,53 @@ Standard.args = {
86
89
  supertitle: "Card supertitle",
87
90
  title: "Card title",
88
91
  headingLevel: 3,
89
- headingSize: "m",
92
+ headingSize: "s",
93
+ href: "#",
94
+ imageSrc:
95
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
96
+ imageAlt: "The National Archives office",
97
+ imageWidth: 499,
98
+ imageHeight: 333,
99
+ label: "New",
100
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
101
+ htmlElement: "article",
102
+ classes: "tna-card--demo",
103
+ };
104
+
105
+ export const Simple = Template.bind({});
106
+ Simple.args = {
107
+ title: "Card title",
108
+ headingLevel: 3,
109
+ headingSize: "s",
110
+ imageSrc:
111
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
112
+ imageAlt: "The National Archives office",
113
+ imageWidth: 499,
114
+ imageHeight: 333,
115
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
116
+ htmlElement: "article",
117
+ classes: "tna-card--demo",
118
+ };
119
+
120
+ export const Meta = Template.bind({});
121
+ Meta.args = {
122
+ supertitle: "Card supertitle",
123
+ title: "Card title",
124
+ headingLevel: 3,
125
+ headingSize: "s",
90
126
  href: "#",
91
127
  imageSrc:
92
128
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
93
129
  imageAlt: "The National Archives office",
94
- imageWidth: 1996,
95
- imageHeight: 1331,
130
+ imageWidth: 499,
131
+ imageHeight: 333,
96
132
  label: "New",
97
- body: "<p>Card body</p>",
133
+ meta: [
134
+ { text: "24th September 2023", icon: "calendar" },
135
+ { text: "From £16", icon: "ticket" },
136
+ { text: "Online", icon: "location-dot" },
137
+ ],
138
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
98
139
  htmlElement: "article",
99
140
  classes: "tna-card--demo",
100
141
  };
@@ -104,15 +145,15 @@ Boxed.args = {
104
145
  supertitle: "Card supertitle",
105
146
  title: "Card title",
106
147
  headingLevel: 3,
107
- headingSize: "m",
148
+ headingSize: "s",
108
149
  href: "#",
109
150
  imageSrc:
110
151
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
111
152
  imageAlt: "The National Archives office",
112
- imageWidth: 1996,
113
- imageHeight: 1331,
153
+ imageWidth: 499,
154
+ imageHeight: 333,
114
155
  label: "New",
115
- body: "<p>Card body</p>",
156
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
116
157
  style: "boxed",
117
158
  htmlElement: "article",
118
159
  classes: "tna-card--demo",
@@ -123,15 +164,15 @@ Accent.args = {
123
164
  supertitle: "Card supertitle",
124
165
  title: "Card title",
125
166
  headingLevel: 3,
126
- headingSize: "m",
167
+ headingSize: "s",
127
168
  href: "#",
128
169
  imageSrc:
129
170
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
130
171
  imageAlt: "The National Archives office",
131
- imageWidth: 1996,
132
- imageHeight: 1331,
172
+ imageWidth: 499,
173
+ imageHeight: 333,
133
174
  label: "New",
134
- body: "<p>Card body</p>",
175
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
135
176
  style: "accent",
136
177
  htmlElement: "article",
137
178
  classes: "tna-card--demo",
@@ -146,10 +187,10 @@ Horizontal.args = {
146
187
  imageSrc:
147
188
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
148
189
  imageAlt: "The National Archives office",
149
- imageWidth: 1996,
150
- imageHeight: 1331,
190
+ imageWidth: 499,
191
+ imageHeight: 333,
151
192
  label: "New",
152
- body: "<p>Card body</p>",
193
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
153
194
  actions: [
154
195
  {
155
196
  text: "Card action",
@@ -172,10 +213,10 @@ HorizontalBoxed.args = {
172
213
  imageSrc:
173
214
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
174
215
  imageAlt: "The National Archives office",
175
- imageWidth: 1996,
176
- imageHeight: 1331,
216
+ imageWidth: 499,
217
+ imageHeight: 333,
177
218
  label: "New",
178
- body: "<p>Card body</p>",
219
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
179
220
  actions: [
180
221
  {
181
222
  text: "Card action",
@@ -199,10 +240,10 @@ HorizontalAccent.args = {
199
240
  imageSrc:
200
241
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
201
242
  imageAlt: "The National Archives office",
202
- imageWidth: 1996,
203
- imageHeight: 1331,
243
+ imageWidth: 499,
244
+ imageHeight: 333,
204
245
  label: "New",
205
- body: "<p>Card body</p>",
246
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
206
247
  actions: [
207
248
  {
208
249
  text: "Card action",
@@ -222,7 +263,7 @@ Sources.args = {
222
263
  supertitle: "Card supertitle",
223
264
  title: "Card title",
224
265
  headingLevel: 3,
225
- headingSize: "m",
266
+ headingSize: "s",
226
267
  imageSrc: "https://www.gstatic.com/webp/gallery/2.jpg",
227
268
  imageAlt: "A man in a canoe paddling through white water",
228
269
  imageWidth: 550,
@@ -233,7 +274,7 @@ Sources.args = {
233
274
  type: "image/webp",
234
275
  },
235
276
  ],
236
- body: "<p>Card body</p>",
277
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
237
278
  htmlElement: "article",
238
279
  classes: "tna-card--demo",
239
280
  };
@@ -243,8 +284,8 @@ WithoutImage.args = {
243
284
  supertitle: "Card supertitle",
244
285
  title: "Card title",
245
286
  headingLevel: 3,
246
- headingSize: "m",
247
- body: "<p>Card body</p>",
287
+ headingSize: "s",
288
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
248
289
  htmlElement: "article",
249
290
  classes: "tna-card--demo",
250
291
  };
@@ -302,18 +343,16 @@ const GridTemplate = ({
302
343
 
303
344
  export const Grid = GridTemplate.bind({});
304
345
  Grid.args = {
305
- supertitle: "Card supertitle",
306
346
  title: "Card title",
307
347
  headingLevel: 3,
308
- headingSize: "m",
348
+ headingSize: "s",
309
349
  href: "#",
310
350
  imageSrc:
311
351
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
312
352
  imageAlt: "The National Archives office",
313
- imageWidth: 1996,
314
- imageHeight: 1331,
315
- label: "New",
316
- body: "<p>Card body</p>",
353
+ imageWidth: 499,
354
+ imageHeight: 333,
355
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
317
356
  htmlElement: "article",
318
357
  classes: "tna-card--demo",
319
358
  };
@@ -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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
11
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-hgroup--m 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>",
22
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-hgroup 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
  {
@@ -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 tna-heading--m tna-card__heading\">Card title</h1><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
43
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h1 class=\" tna-heading 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 tna-heading--m 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>",
54
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
88
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m 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>",
102
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m 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>",
122
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m 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>",
137
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m 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>",
154
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
165
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
176
+ "html": "<div class=\"tna-card tna-card--contrast\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
187
+ "html": "<div class=\"tna-card tna-card--accent\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
198
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
209
+ "html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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 tna-heading--m tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
222
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading 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
  ]
@@ -98,6 +98,26 @@
98
98
  "required": false,
99
99
  "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
100
  },
101
+ {
102
+ "name": "meta",
103
+ "type": "array",
104
+ "required": false,
105
+ "description": "Small pieces of additional information akin to subtitles, displayed between the title and the body.",
106
+ "params": [
107
+ {
108
+ "name": "text",
109
+ "type": "string",
110
+ "required": true,
111
+ "description": "The text element of the meta data."
112
+ },
113
+ {
114
+ "name": "icon",
115
+ "type": "string",
116
+ "required": false,
117
+ "description": "The name of a font-awesome icon, without the prefixed `fa-`."
118
+ }
119
+ ]
120
+ },
101
121
  {
102
122
  "name": "body",
103
123
  "type": "string",
@@ -10,8 +10,8 @@
10
10
  {%- endif -%}
11
11
  <{{ htmlElement }} class="tna-card {{ containerClasses | join(' ') }}" data-module="tna-card" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
12
12
  <div class="tna-card__inner">
13
- {%- if params.supertitle -%}
14
- <hgroup class="tna-hgroup tna-hgroup--{{ params.headingSize or 'm' }} tna-card__heading">
13
+ {%- if params.supertitle -%}
14
+ <hgroup class="tna-hgroup tna-hgroup--{{ params.headingSize or 's' }} tna-card__heading">
15
15
  <h{{ params.headingLevel }} class="tna-hgroup__title">
16
16
  <span class="tna-hgroup__supertitle">{{ params.supertitle }}</span>
17
17
  {%- if params.href -%}
@@ -21,42 +21,54 @@
21
21
  {%- endif -%}
22
22
  </h{{ params.headingLevel }}>
23
23
  </hgroup>
24
- {%- else -%}
25
- <h{{ params.headingLevel }} class=" tna-heading tna-heading--{{ params.headingSize or 'm' }} tna-card__heading">
24
+ {%- else -%}
25
+ <h{{ params.headingLevel }} class=" tna-heading tna-heading--{{ params.headingSize or 's' }} tna-card__heading">
26
26
  {%- if params.href -%}
27
27
  <a href="{{ params.href }}" class="tna-card__heading-link">{{ params.title }}</a>
28
28
  {%- else -%}
29
29
  {{ params.title }}
30
30
  {%- endif -%}
31
31
  </h{{ params.headingLevel }}>
32
+ {%- endif -%}
33
+ {%- if params.imageSrc -%}
34
+ {%- if params.href -%}
35
+ <a href="{{ params.href }}" class="tna-card__image-container" tabindex="-1">
36
+ {%- else -%}
37
+ <div class="tna-card__image-container">
32
38
  {%- endif -%}
33
- {%- if params.imageSrc -%}
34
- {%- if params.href -%}
35
- <a href="{{ params.href }}" class="tna-card__image-container" tabindex="-1">
36
- {%- else -%}
37
- <div class="tna-card__image-container">
38
- {%- endif -%}
39
- <picture class="tna-card__image">
40
- {%- if params.imageSources -%}
41
- {%- for source in params.imageSources -%}
42
- <source srcset="{{ source.src }}" type="{{ source.type }}" width="{{ source.width if source.width else params.imageWidth }}" height="{{ source.height if source.height else params.imageHeight }}">
43
- {%- endfor -%}
44
- <source srcset="{{ params.imageSrc }}" type="image/jpeg" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
45
- {%- endif -%}
46
- <img src="{{ params.imageSrc }}" alt="{{ params.imageAlt }}" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
47
- </picture>
48
- {%- if params.label -%}
49
- <div class="tna-chip tna-card__image-label">
50
- {{ params.label }}
51
- </div>
39
+ <picture class="tna-card__image">
40
+ {%- if params.imageSources -%}
41
+ {%- for source in params.imageSources -%}
42
+ <source srcset="{{ source.src }}" type="{{ source.type }}" width="{{ source.width if source.width else params.imageWidth }}" height="{{ source.height if source.height else params.imageHeight }}">
43
+ {%- endfor -%}
44
+ <source srcset="{{ params.imageSrc }}" type="image/jpeg" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
52
45
  {%- endif -%}
53
- {%- if params.href -%}
54
- </a>
55
- {%- else -%}
46
+ <img src="{{ params.imageSrc }}" alt="{{ params.imageAlt }}" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
47
+ </picture>
48
+ {%- if params.label -%}
49
+ <div class="tna-chip tna-card__image-label">
50
+ {{ params.label }}
56
51
  </div>
57
52
  {%- endif -%}
53
+ {%- if params.href -%}
54
+ </a>
55
+ {%- else -%}
56
+ </div>
58
57
  {%- endif -%}
58
+ {%- endif -%}
59
59
  <div class="tna-card__body">
60
+ {%- if params.meta -%}
61
+ <ul class="tna-card__meta">
62
+ {%- for item in params.meta -%}
63
+ <li class="tna-card__meta-item">
64
+ {%- if item.icon -%}
65
+ <i class="fa-solid fa-{{ item.icon }}"></i>
66
+ {%- endif -%}
67
+ {{ item.text }}
68
+ </li>
69
+ {%- endfor -%}
70
+ </ul>
71
+ {%- endif -%}
60
72
  {%- if params.text -%}
61
73
  <p>{{ params.text }}</p>
62
74
  {%- else -%}