@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
@@ -0,0 +1,59 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/Using/NPM" />
4
+
5
+ # Using with npm
6
+
7
+ Install the frontend package from NPM with:
8
+
9
+ ```sh
10
+ npm install @nationalarchives/frontend
11
+ ```
12
+
13
+ ## CSS
14
+
15
+ From here, you have access to include the SCSS files from the package so you can compile the package yourself:
16
+
17
+ ```css
18
+ // OPTIONAL: Override any variables
19
+ @use "node_modules/@nationalarchives/frontend/nationalarchives/variables/assets" with (
20
+ $tna-font-path: "/MY_CUSTOM_FONTS_PATH",
21
+ $fa-font-path: "/MY_CUSTOM_FONT_AWESOME_PATH"
22
+ );
23
+ @use "node_modules/@nationalarchives/frontend/nationalarchives/variables/grid" with (
24
+ $largest-container-width: 1337px
25
+ );
26
+ @use "node_modules/@nationalarchives/frontend/nationalarchives/variables/typography" with (
27
+ $body-font-size-px: 17
28
+ );
29
+
30
+ // Include all the styles
31
+ @use "node_modules/@nationalarchives/frontend/nationalarchives/all";
32
+
33
+ // ...or just include a single component
34
+ @use "node_modules/@nationalarchives/frontend/nationalarchives/components/tabs";
35
+ ```
36
+
37
+ ...or you can copy any of the compiled CSS files into your distribution:
38
+
39
+ - `node_modules/@nationalarchives/frontend/nationalarchives/all.css`
40
+ - `node_modules/@nationalarchives/frontend/nationalarchives/all.css.map`
41
+ - `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.css`
42
+ - `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.css.map`
43
+
44
+ ## JavaScript
45
+
46
+ ```JavaScript
47
+ // Import all the JavaScript
48
+ import "node_modules/@nationalarchives/frontend/nationalarchives/all.mjs";
49
+
50
+ // ...or import just the JavaScript for a single component
51
+ import "node_modules/@nationalarchives/frontend/nationalarchives/components/tabs/tabs.mjs";
52
+ ```
53
+
54
+ ...or you can copy any of the compiled JavaScript files into your distribution:
55
+
56
+ - `node_modules/@nationalarchives/frontend/nationalarchives/all.js`
57
+ - `node_modules/@nationalarchives/frontend/nationalarchives/all.js.map`
58
+ - `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.js`
59
+ - `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.js.map`
@@ -9,6 +9,7 @@ import Header from "../../../components/header/template.njk";
9
9
  import Hero from "../../../components/hero/template.njk";
10
10
  import IndexGrid from "../../../components/index-grid/template.njk";
11
11
  import Message from "../../../components/message/template.njk";
12
+ import Pagination from "../../../components/pagination/template.njk";
12
13
  import PhaseBanner from "../../../components/phase-banner/template.njk";
13
14
  import Picture from "../../../components/picture/template.njk";
14
15
  import Tabs from "../../../components/tabs/template.njk";
@@ -40,13 +41,13 @@ const Template = ({ theme, accent }) => {
40
41
  supertitle: "Card supertitle",
41
42
  title: "Card title",
42
43
  headingLevel: 3,
43
- headingSize: "m",
44
+ headingSize: "s",
44
45
  href: "#",
45
46
  imageSrc:
46
47
  "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
47
48
  imageAlt: "The National Archives office",
48
- imageWidth: 1996,
49
- imageHeight: 1331,
49
+ imageWidth: 499,
50
+ imageHeight: 333,
50
51
  label: "New",
51
52
  body: "<p>Card body</p>",
52
53
  actions: [
@@ -86,11 +87,13 @@ const Template = ({ theme, accent }) => {
86
87
  : ""
87
88
  }">
88
89
  <div class="tna-template__body tna-template__body--padded">
90
+ <!--
89
91
  ${CookieBanner({
90
92
  params: {
91
93
  cookiesUrl: "#",
92
94
  },
93
95
  })}
96
+ -->
94
97
  ${SkipLink({
95
98
  params: {
96
99
  href: "main-content",
@@ -156,18 +159,19 @@ const Template = ({ theme, accent }) => {
156
159
  ${Hero({
157
160
  params: {
158
161
  heading: "Title",
159
- image: {
160
- src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
161
- alt: "The National Archives office",
162
- width: 1996,
163
- height: 1331,
164
- },
162
+ body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
163
+ imageSrc:
164
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
165
+ imageAlt: "The National Archives office",
166
+ imageWidth: 499,
167
+ imageHeight: 333,
168
+ imageCaption: "An interesting photo by a famous photographer ©2023",
165
169
  classes: "tna-hero--demo",
166
170
  },
167
171
  })}
168
172
  <div class="tna-container tna-section">
169
173
  <div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny">
170
- <hgroup class="tna-hgroup tna-hgroup--xl">
174
+ <hgroup class="tna-hgroup tna-hgroup--l">
171
175
  <p class="tna-hgroup__supertitle">TNA colour theme</p>
172
176
  <h2 class="tna-hgroup__title">Heading</h2>
173
177
  </hgroup>
@@ -224,12 +228,36 @@ const Template = ({ theme, accent }) => {
224
228
  })}
225
229
  </div>
226
230
  </div>
227
- <div class="tna-column tna-column--width-1-3 tna-column--full-small tna-column--full-tiny">
228
- <div class="tna-aside tna-background--contrast tna-!--margin-top-l-small tna-!--margin-top-xl-tiny">
229
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh.</p>
230
- </div>
231
- <div class="tna-aside tna-background--accent">
232
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh.</p>
231
+ <div class="tna-column tna-column--no-padding tna-column--width-1-3 tna-column--full-medium tna-column--full-small tna-column--full-tiny">
232
+ <div class="tna-container tna-container--no-padding">
233
+ <div class="tna-column tna-column--full tna-column--width-1-2-medium tna-column--width-1-2-small tna-!--margin-top-l-medium tna-!--margin-top-l-small tna-!--margin-top-l-tiny">
234
+ <div class="tna-aside tna-background--contrast">
235
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh.</p>
236
+ <div class="tna-button-group">
237
+ ${Button({
238
+ params: {
239
+ text: "Accent button",
240
+ href: "#",
241
+ accent: true,
242
+ },
243
+ })}
244
+ </div>
245
+ </div>
246
+ </div>
247
+ <div class="tna-column tna-column--full tna-column--width-1-2-medium tna-column--width-1-2-small tna-!--margin-top-m tna-!--margin-top-l-medium tna-!--margin-top-l-small tna-!--margin-top-l-tiny">
248
+ <div class="tna-aside tna-background--accent">
249
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh.</p>
250
+ <div class="tna-button-group">
251
+ ${Button({
252
+ params: {
253
+ text: "Primary button",
254
+ href: "#",
255
+ classes: "tna-button--solid-hover",
256
+ },
257
+ })}
258
+ </div>
259
+ </div>
260
+ </div>
233
261
  </div>
234
262
  </div>
235
263
  </div>
@@ -281,17 +309,65 @@ const Template = ({ theme, accent }) => {
281
309
  </div>
282
310
  <p class="tna-blockquote__author">Douglas Adams, Mostly Harmless</p>
283
311
  </blockquote>
284
- <h2 class="tna-heading tna-heading--l">
312
+ <h2 class="tna-heading tna-heading--m">
285
313
  <a href="#">Reaerching with The National Archives</a>
286
314
  </h2>
287
315
  <p>Lorem ipsum <a href="#">link</a></p>
288
- <hgroup class="tna-hgroup tna-hgroup--l">
316
+ <hgroup class="tna-hgroup tna-hgroup--m">
289
317
  <p class="tna-hgroup__supertitle">Supertitle</p>
290
318
  <h2 class="tna-hgroup__title">
291
319
  <a href="#">Reaerching with The National Archives</a>
292
320
  </h2>
293
321
  </hgroup>
294
322
  <p>Lorem ipsum <a href="#">link</a></p>
323
+ </div>
324
+ <div class="tna-column tna-column--width-1-2 tna-column--full-small tna-column--full-tiny tna-!--margin-top-m">
325
+ <h3 class="tna-heading tna-heading--m">
326
+ Descriptions
327
+ </h3>
328
+ <dl class="tna-dl">
329
+ <dt>Alpha</dt>
330
+ <dd>Lorem ipsum</dd>
331
+ <dt>Beta</dt>
332
+ <dd>Lorem ipsum</dd>
333
+ <dt>Gamma</dt>
334
+ <dd>Lorem ipsum</dd>
335
+ </dl>
336
+ </div>
337
+ <div class="tna-column tna-column--width-1-2 tna-column--full-small tna-column--full-tiny tna-!--margin-top-m">
338
+ <h3 class="tna-heading tna-heading--m">
339
+ Descriptions
340
+ </h3>
341
+ <dl class="tna-dl tna-dl--plain">
342
+ <dt>Alpha</dt>
343
+ <dd>Lorem ipsum</dd>
344
+ <dt>Beta</dt>
345
+ <dd>Lorem ipsum</dd>
346
+ <dt>Gamma</dt>
347
+ <dd>Lorem ipsum</dd>
348
+ </dl>
349
+ </div>
350
+ <div class="tna-column tna-column--full tna-!--margin-top-m">
351
+ <h3 class="tna-heading tna-heading--m">
352
+ Descriptions
353
+ </h3>
354
+ <dl class="tna-dl tna-dl--icon-padding ">
355
+ <dt>
356
+ <i class="fa-solid fa-landmark"></i>
357
+ Held by
358
+ </dt>
359
+ <dd>The National Archives, Kew</dd>
360
+ <dt>
361
+ <i class="fa-solid fa-calendar"></i>
362
+ Date
363
+ </dt>
364
+ <dd>1972–1979</dd>
365
+ <dt>
366
+ <i class="fa-solid fa-database"></i>
367
+ Reference
368
+ </dt>
369
+ <dd>LC 4</dd>
370
+ </dl>
295
371
  <h2 class="tna-heading tna-heading--l">
296
372
  Categories
297
373
  </h2>
@@ -325,7 +401,17 @@ const Template = ({ theme, accent }) => {
325
401
  <p class="tna-!--no-margin-bottom tna-!--padding-top-xl">Lorem ipsum</p>
326
402
  </div>
327
403
  </div>
328
- <hr>
404
+ ${Hero({
405
+ params: {
406
+ imageSrc:
407
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
408
+ imageAlt: "The National Archives office",
409
+ imageWidth: 499,
410
+ imageHeight: 333,
411
+ imageCaption: "An interesting photo by a famous photographer ©2023",
412
+ classes: "tna-hero--demo",
413
+ },
414
+ })}
329
415
  <div class="tna-container tna-section tna-!--padding-bottom-s">
330
416
  <div class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny">
331
417
  ${Card({
@@ -420,8 +506,8 @@ const Template = ({ theme, accent }) => {
420
506
  params: {
421
507
  src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
422
508
  alt: "The National Archives office",
423
- width: 1996,
424
- height: 1331,
509
+ width: 499,
510
+ height: 333,
425
511
  caption: "<p>This is a pretty image</p>",
426
512
  transcript: "<p>Lorem ipsum transcript</p>",
427
513
  translation: "<p>Lorem ipsum translation</p>",
@@ -521,9 +607,51 @@ const Template = ({ theme, accent }) => {
521
607
  })}
522
608
  <div class="tna-container">
523
609
  <div class="tna-column tna-column--full">
610
+ ${Pagination({
611
+ params: {
612
+ landmarkLabel: "My dogs 1 results",
613
+ previous: {
614
+ href: "#",
615
+ },
616
+ items: [
617
+ {
618
+ number: 1,
619
+ href: "#",
620
+ },
621
+ {
622
+ ellipsis: true,
623
+ },
624
+ {
625
+ number: 6,
626
+ href: "#",
627
+ },
628
+ {
629
+ number: 7,
630
+ current: true,
631
+ href: "#",
632
+ },
633
+ {
634
+ number: 8,
635
+ href: "#",
636
+ },
637
+ {
638
+ ellipsis: true,
639
+ },
640
+ {
641
+ number: 42,
642
+ href: "#",
643
+ },
644
+ ],
645
+ next: {
646
+ href: "#",
647
+ },
648
+ classes: "tna-pagination--demo",
649
+ },
650
+ })}
524
651
  <div class="tna-button-group">
525
- <a href="#" class="tna-button">Primary button</a>
526
- <a href="#" class="tna-button tna-button--accent">Accent button</a>
652
+ <a href="#" class="tna-button" role="button">Primary button</a>
653
+ <a href="#" class="tna-button tna-button--accent" role="button">Accent button</a>
654
+ <a href="" class="tna-button tna-button--plain" role="button">Plain button</a>
527
655
  </div>
528
656
  </div>
529
657
  </div>
@@ -561,9 +689,51 @@ const Template = ({ theme, accent }) => {
561
689
  })}
562
690
  <div class="tna-container">
563
691
  <div class="tna-column tna-column--full">
692
+ ${Pagination({
693
+ params: {
694
+ landmarkLabel: "My dogs 2 results",
695
+ previous: {
696
+ href: "#",
697
+ },
698
+ items: [
699
+ {
700
+ number: 1,
701
+ href: "#",
702
+ },
703
+ {
704
+ ellipsis: true,
705
+ },
706
+ {
707
+ number: 6,
708
+ href: "#",
709
+ },
710
+ {
711
+ number: 7,
712
+ current: true,
713
+ href: "#",
714
+ },
715
+ {
716
+ number: 8,
717
+ href: "#",
718
+ },
719
+ {
720
+ ellipsis: true,
721
+ },
722
+ {
723
+ number: 42,
724
+ href: "#",
725
+ },
726
+ ],
727
+ next: {
728
+ href: "#",
729
+ },
730
+ classes: "tna-pagination--demo",
731
+ },
732
+ })}
564
733
  <div class="tna-button-group">
565
- <a href="#" class="tna-button">Primary button</a>
566
- <a href="#" class="tna-button tna-button--accent">Accent button</a>
734
+ <a href="#" class="tna-button" role="button">Primary button</a>
735
+ <a href="#" class="tna-button tna-button--accent" role="button">Accent button</a>
736
+ <a href="" class="tna-button tna-button--plain" role="button">Plain button</a>
567
737
  </div>
568
738
  </div>
569
739
  </div>
@@ -601,9 +771,51 @@ const Template = ({ theme, accent }) => {
601
771
  })}
602
772
  <div class="tna-container">
603
773
  <div class="tna-column tna-column--full">
774
+ ${Pagination({
775
+ params: {
776
+ landmarkLabel: "My dogs 3 results",
777
+ previous: {
778
+ href: "#",
779
+ },
780
+ items: [
781
+ {
782
+ number: 1,
783
+ href: "#",
784
+ },
785
+ {
786
+ ellipsis: true,
787
+ },
788
+ {
789
+ number: 6,
790
+ href: "#",
791
+ },
792
+ {
793
+ number: 7,
794
+ current: true,
795
+ href: "#",
796
+ },
797
+ {
798
+ number: 8,
799
+ href: "#",
800
+ },
801
+ {
802
+ ellipsis: true,
803
+ },
804
+ {
805
+ number: 42,
806
+ href: "#",
807
+ },
808
+ ],
809
+ next: {
810
+ href: "#",
811
+ },
812
+ classes: "tna-pagination--demo",
813
+ },
814
+ })}
604
815
  <div class="tna-button-group">
605
- <a href="#" class="tna-button">Primary button</a>
606
- <a href="#" class="tna-button tna-button--accent">Accent button</a>
816
+ <a href="#" class="tna-button" role="button">Primary button</a>
817
+ <a href="#" class="tna-button tna-button--accent" role="button">Accent button</a>
818
+ <a href="" class="tna-button tna-button--plain" role="button">Plain button</a>
607
819
  </div>
608
820
  </div>
609
821
  </div>
@@ -641,8 +853,51 @@ const Template = ({ theme, accent }) => {
641
853
  })}
642
854
  <div class="tna-container">
643
855
  <div class="tna-column tna-column--full">
856
+ ${Pagination({
857
+ params: {
858
+ landmarkLabel: "My dogs 4 results",
859
+ previous: {
860
+ href: "#",
861
+ },
862
+ items: [
863
+ {
864
+ number: 1,
865
+ href: "#",
866
+ },
867
+ {
868
+ ellipsis: true,
869
+ },
870
+ {
871
+ number: 6,
872
+ href: "#",
873
+ },
874
+ {
875
+ number: 7,
876
+ current: true,
877
+ href: "#",
878
+ },
879
+ {
880
+ number: 8,
881
+ href: "#",
882
+ },
883
+ {
884
+ ellipsis: true,
885
+ },
886
+ {
887
+ number: 42,
888
+ href: "#",
889
+ },
890
+ ],
891
+ next: {
892
+ href: "#",
893
+ },
894
+ classes: "tna-pagination--demo",
895
+ },
896
+ })}
644
897
  <div class="tna-button-group">
645
- <a href="#" class="tna-button">Primary button</a>
898
+ <a href="#" class="tna-button" role="button">Primary button</a>
899
+ <a href="#" class="tna-button tna-button--accent" role="button">Accent button</a>
900
+ <a href="" class="tna-button tna-button--plain" role="button">Plain button</a>
646
901
  </div>
647
902
  </div>
648
903
  </div>
@@ -730,7 +985,7 @@ const Template = ({ theme, accent }) => {
730
985
  ],
731
986
  },
732
987
  {
733
- title: "Our websites help",
988
+ title: "Our websites",
734
989
  items: [
735
990
  {
736
991
  text: "UK Government Web Archive",
@@ -19,7 +19,10 @@ const HeadingsTemplate = ({ text }) =>
19
19
  `${HeadingTemplate({ params: { text, size: "xl" } }, 1)}${HeadingTemplate(
20
20
  { params: { text, size: "l" } },
21
21
  2,
22
- )}${HeadingTemplate({ params: { text, size: "m" } }, 3)}`;
22
+ )}${HeadingTemplate({ params: { text, size: "m" } }, 3)}${HeadingTemplate(
23
+ { params: { text, size: "s" } },
24
+ 4,
25
+ )}`;
23
26
 
24
27
  export const Headings = HeadingsTemplate.bind({});
25
28
  Headings.args = {
@@ -1,5 +1,6 @@
1
1
  const argTypes = {
2
2
  items: { control: "object" },
3
+ plain: { control: "boolean" },
3
4
  };
4
5
 
5
6
  export default {
@@ -36,3 +37,95 @@ OrderedListPlain.args = {
36
37
  items: ["Alpha", "Beta", "Gamma"],
37
38
  plain: true,
38
39
  };
40
+
41
+ const DescriptionListTemplate = ({ items, plain }) =>
42
+ `<dl class="tna-dl${plain ? " tna-dl--plain" : ""}${
43
+ items.some((item) => item.icon) ? " tna-dl--icon-padding" : ""
44
+ }">${items.reduce(
45
+ (list, item) => `${list}
46
+ <dt>
47
+ ${item.icon ? `<i class="fa-solid fa-${item.icon}"></i>` : ""}
48
+ ${item.title}
49
+ </dt>
50
+ ${
51
+ Array.isArray(item.description)
52
+ ? item.description.reduce(
53
+ (descriptions, description) =>
54
+ `${descriptions}<dd>${description}</dd>`,
55
+ "",
56
+ )
57
+ : `<dd>${item.description}</dd>`
58
+ }`,
59
+ "",
60
+ )}
61
+ </dl>`;
62
+
63
+ export const DescriptionList = DescriptionListTemplate.bind({});
64
+ DescriptionList.args = {
65
+ items: [
66
+ { title: "Alpha", description: "Lorem ipsum" },
67
+ { title: "Beta", description: "Lorem ipsum" },
68
+ { title: "Gamma", description: "Lorem ipsum" },
69
+ { title: "Delta", description: "Lorem ipsum" },
70
+ { title: "Epsilon", description: "Lorem ipsum" },
71
+ { title: "Zeta", description: "Lorem ipsum" },
72
+ { title: "Eta", description: "Lorem ipsum" },
73
+ ],
74
+ };
75
+
76
+ export const PlainDescriptionList = DescriptionListTemplate.bind({});
77
+ PlainDescriptionList.args = {
78
+ items: [
79
+ { title: "Alpha", description: "Lorem ipsum" },
80
+ { title: "Beta", description: "Lorem ipsum" },
81
+ { title: "Gamma", description: "Lorem ipsum" },
82
+ { title: "Delta", description: "Lorem ipsum" },
83
+ ],
84
+ plain: true,
85
+ };
86
+
87
+ export const DescriptionListWithIcons = DescriptionListTemplate.bind({});
88
+ DescriptionListWithIcons.args = {
89
+ items: [
90
+ {
91
+ title: "Held by",
92
+ description: "The National Archives, Kew",
93
+ icon: "landmark",
94
+ },
95
+ { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
96
+ { title: "Reference", description: "LC 4", icon: "database" },
97
+ ],
98
+ };
99
+
100
+ export const PlainDescriptionListWithIcons = DescriptionListTemplate.bind({});
101
+ PlainDescriptionListWithIcons.args = {
102
+ items: [
103
+ {
104
+ title: "Held by",
105
+ description: "The National Archives, Kew",
106
+ icon: "landmark",
107
+ },
108
+ { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
109
+ { title: "Reference", description: "LC 4", icon: "database" },
110
+ ],
111
+ plain: true,
112
+ };
113
+
114
+ export const ComplexDescriptionList = DescriptionListTemplate.bind({});
115
+ ComplexDescriptionList.args = {
116
+ items: [
117
+ { title: "Alpha", description: "Lorem ipsum" },
118
+ { title: "Beta", description: "Lorem ipsum" },
119
+ {
120
+ title: "Gamma",
121
+ description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
122
+ },
123
+ {
124
+ title: "Delta",
125
+ description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
126
+ },
127
+ { title: "Epsilon", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
128
+ { title: "Zeta", description: "Lorem ipsum" },
129
+ { title: "Eta", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
130
+ ],
131
+ };
@@ -32,7 +32,17 @@ In the second example, the heading will be read as two separate sentences; `Reco
32
32
  <Canvas of={TypographyStories.Paragraph} />
33
33
  <Canvas of={TypographyStories.Blockquote} />
34
34
  <Canvas of={TypographyStories.SceneSetter} />
35
+
36
+ ## Lists
37
+
35
38
  <Canvas of={ListStories.UnorderedList} />
36
- <Canvas of={ListStories.UnorderedListPlain} />
37
39
  <Canvas of={ListStories.OrderedList} />
40
+ <Canvas of={ListStories.DescriptionList} />
41
+ <Canvas of={ListStories.DescriptionListWithIcons} />
42
+
43
+ ### Plain versions
44
+
45
+ <Canvas of={ListStories.UnorderedListPlain} />
38
46
  <Canvas of={ListStories.OrderedListPlain} />
47
+ <Canvas of={ListStories.PlainDescriptionList} />
48
+ <Canvas of={ListStories.PlainDescriptionListWithIcons} />
@@ -19,7 +19,7 @@ Paragraph.args = {
19
19
  };
20
20
 
21
21
  const HeadingLinkTemplate = ({ text, href }) =>
22
- `<h2 class="tna-heading">
22
+ `<h2 class="tna-heading tna-heading--s">
23
23
  <a href="${href}">${text}</a>
24
24
  </h2>`;
25
25
  export const HeadingLink = HeadingLinkTemplate.bind({});