@nationalarchives/frontend 0.1.19-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 +92 -106
  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
@@ -4,146 +4,144 @@
4
4
  {
5
5
  "name": "basic card",
6
6
  "options": {
7
- "heading": {
8
- "title": "Card title",
9
- "level": 3
10
- },
7
+ "title": "Card title",
8
+ "headingLevel": 3,
11
9
  "body": "<p>Card body</p>"
12
10
  },
13
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
14
12
  "hidden": false
15
13
  },
16
14
  {
17
15
  "name": "with supertitle",
18
16
  "options": {
19
- "heading": {
20
- "supertitle": "Card supertitle",
21
- "title": "Card title",
22
- "level": 3
23
- },
17
+ "supertitle": "Card supertitle",
18
+ "title": "Card title",
19
+ "headingLevel": 3,
24
20
  "body": "<p>Card body</p>"
25
21
  },
26
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
27
23
  "hidden": false
28
24
  },
29
25
  {
30
26
  "name": "heading size",
31
27
  "options": {
32
- "heading": {
33
- "title": "Card title",
34
- "level": 3,
35
- "size": "m"
36
- },
28
+ "title": "Card title",
29
+ "headingLevel": 3,
30
+ "headingSize": "xl",
37
31
  "body": "<p>Card body</p>"
38
32
  },
39
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
33
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\" tna-heading tna-heading--xl tna-card__heading\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
40
34
  "hidden": false
41
35
  },
42
36
  {
43
37
  "name": "heading level",
44
38
  "options": {
45
- "heading": {
46
- "title": "Card title",
47
- "level": 1
48
- },
39
+ "title": "Card title",
40
+ "headingLevel": 1,
49
41
  "body": "<p>Card body</p>"
50
42
  },
51
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
52
44
  "hidden": false
53
45
  },
54
46
  {
55
47
  "name": "with link",
56
48
  "options": {
57
- "heading": {
58
- "title": "Card title",
59
- "level": 3
60
- },
49
+ "title": "Card title",
50
+ "headingLevel": 3,
61
51
  "href": "#",
62
52
  "body": "<p>Card body</p>"
63
53
  },
64
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"><a href=\"#\" class=\"tna-card__heading-link\"></a></h><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>",
65
79
  "hidden": false
66
80
  },
67
81
  {
68
82
  "name": "with text",
69
83
  "options": {
70
- "heading": {
71
- "title": "Card title",
72
- "level": 3
73
- },
84
+ "title": "Card title",
85
+ "headingLevel": 3,
74
86
  "text": "Card body"
75
87
  },
76
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
77
89
  "hidden": false
78
90
  },
79
91
  {
80
92
  "name": "with image",
81
93
  "options": {
82
- "heading": {
83
- "title": "Card title",
84
- "level": 3
85
- },
86
- "image": {
87
- "src": "https://loremflickr.com/640/360",
88
- "alt": "A placeholder image",
89
- "width": 640,
90
- "height": 360
91
- },
94
+ "title": "Card title",
95
+ "headingLevel": 3,
96
+ "imageSrc": "https://loremflickr.com/640/360",
97
+ "imageAlt": "A placeholder image",
98
+ "imageWidth": 640,
99
+ "imageHeight": 360,
92
100
  "body": "<p>Card body</p>"
93
101
  },
94
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
95
103
  "hidden": false
96
104
  },
97
105
  {
98
106
  "name": "with image and alternative sources",
99
107
  "options": {
100
- "heading": {
101
- "title": "Card title",
102
- "level": 3
103
- },
104
- "image": {
105
- "src": "https://loremflickr.com/640/360",
106
- "alt": "A placeholder image",
107
- "width": 640,
108
- "height": 360,
109
- "sources": [
110
- {
111
- "src": "https://www.gstatic.com/webp/gallery/2.webp",
112
- "type": "image/webp"
113
- }
114
- ]
115
- },
108
+ "title": "Card title",
109
+ "headingLevel": 3,
110
+ "imageSrc": "https://loremflickr.com/640/360",
111
+ "imageAlt": "A placeholder image",
112
+ "imageWidth": 640,
113
+ "imageHeight": 360,
114
+ "imageSources": [
115
+ {
116
+ "src": "https://www.gstatic.com/webp/gallery/2.webp",
117
+ "type": "image/webp"
118
+ }
119
+ ],
116
120
  "body": "<p>Card body</p>"
117
121
  },
118
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
119
123
  "hidden": false
120
124
  },
121
125
  {
122
126
  "name": "with link and image",
123
127
  "options": {
124
- "heading": {
125
- "title": "Card title",
126
- "level": 3
127
- },
128
- "image": {
129
- "src": "https://loremflickr.com/640/360",
130
- "alt": "A placeholder image",
131
- "width": 640,
132
- "height": 360
133
- },
128
+ "title": "Card title",
129
+ "headingLevel": 3,
130
+ "imageSrc": "https://loremflickr.com/640/360",
131
+ "imageAlt": "A placeholder image",
132
+ "imageWidth": 640,
133
+ "imageHeight": 360,
134
134
  "href": "#",
135
135
  "body": "<p>Card body</p>"
136
136
  },
137
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"><a href=\"#\" class=\"tna-card__heading-link\"></a></h><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>",
138
138
  "hidden": false
139
139
  },
140
140
  {
141
141
  "name": "with actions",
142
142
  "options": {
143
- "heading": {
144
- "title": "Card title",
145
- "level": 3
146
- },
143
+ "title": "Card title",
144
+ "headingLevel": 3,
147
145
  "body": "<p>Card body</p>",
148
146
  "actions": [
149
147
  {
@@ -153,87 +151,75 @@
153
151
  }
154
152
  ]
155
153
  },
156
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
157
155
  "hidden": false
158
156
  },
159
157
  {
160
158
  "name": "with a label",
161
159
  "options": {
162
- "heading": {
163
- "title": "Card title",
164
- "level": 3
165
- },
160
+ "title": "Card title",
161
+ "headingLevel": 3,
166
162
  "label": "New",
167
163
  "body": "<p>Card body</p>"
168
164
  },
169
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
170
166
  "hidden": false
171
167
  },
172
168
  {
173
169
  "name": "with a boxed style",
174
170
  "options": {
175
- "heading": {
176
- "title": "Card title",
177
- "level": 3
178
- },
171
+ "title": "Card title",
172
+ "headingLevel": 3,
179
173
  "body": "<p>Card body</p>",
180
174
  "style": "boxed"
181
175
  },
182
- "html": "<div class=\"tna-card tna-card--contrast\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
183
177
  "hidden": false
184
178
  },
185
179
  {
186
180
  "name": "with a accent style",
187
181
  "options": {
188
- "heading": {
189
- "title": "Card title",
190
- "level": 3
191
- },
182
+ "title": "Card title",
183
+ "headingLevel": 3,
192
184
  "body": "<p>Card body</p>",
193
185
  "style": "accent"
194
186
  },
195
- "html": "<div class=\"tna-card tna-card--accent\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
196
188
  "hidden": false
197
189
  },
198
190
  {
199
191
  "name": "with an unknown style",
200
192
  "options": {
201
- "heading": {
202
- "title": "Card title",
203
- "level": 3
204
- },
193
+ "title": "Card title",
194
+ "headingLevel": 3,
205
195
  "body": "<p>Card body</p>",
206
196
  "style": "foobar"
207
197
  },
208
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
209
199
  "hidden": false
210
200
  },
211
201
  {
212
202
  "name": "with classes",
213
203
  "options": {
214
- "heading": {
215
- "title": "Card title",
216
- "level": 3
217
- },
204
+ "title": "Card title",
205
+ "headingLevel": 3,
218
206
  "body": "<p>Card body</p>",
219
207
  "classes": "card__test-class"
220
208
  },
221
- "html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
222
210
  "hidden": false
223
211
  },
224
212
  {
225
213
  "name": "with attributes",
226
214
  "options": {
227
- "heading": {
228
- "title": "Card title",
229
- "level": 3
230
- },
215
+ "title": "Card title",
216
+ "headingLevel": 3,
231
217
  "body": "<p>Card body</p>",
232
218
  "attributes": {
233
219
  "data-testattribute": "foobar"
234
220
  }
235
221
  },
236
- "html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h class=\" tna-heading tna-heading--m tna-card__heading\"></h><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>",
237
223
  "hidden": false
238
224
  }
239
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 -%}