@nationalarchives/frontend 0.1.25-prerelease → 0.1.26-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 (190) hide show
  1. package/nationalarchives/all.css +2 -2
  2. package/nationalarchives/all.css.map +1 -1
  3. package/nationalarchives/all.js +1 -1
  4. package/nationalarchives/all.js.map +1 -1
  5. package/nationalarchives/all.mjs +0 -11
  6. package/nationalarchives/components/_index.scss +8 -0
  7. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  8. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  9. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  10. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  11. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +1 -1
  12. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +1 -1
  13. package/nationalarchives/components/button/_button-group.scss +4 -0
  14. package/nationalarchives/components/button/button.css +1 -1
  15. package/nationalarchives/components/button/button.css.map +1 -1
  16. package/nationalarchives/components/button/button.scss +89 -26
  17. package/nationalarchives/components/button/button.stories.js +52 -5
  18. package/nationalarchives/components/button/macro-options.json +18 -0
  19. package/nationalarchives/components/button/template.njk +15 -6
  20. package/nationalarchives/components/card/card.css +1 -1
  21. package/nationalarchives/components/card/card.css.map +1 -1
  22. package/nationalarchives/components/card/card.scss +4 -38
  23. package/nationalarchives/components/card/fixtures.json +1 -1
  24. package/nationalarchives/components/card/template.njk +8 -6
  25. package/nationalarchives/components/checkboxes/_index.scss +1 -0
  26. package/nationalarchives/components/checkboxes/checkboxes.css +1 -0
  27. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -0
  28. package/nationalarchives/components/checkboxes/checkboxes.scss +143 -0
  29. package/nationalarchives/components/checkboxes/checkboxes.stories.js +238 -0
  30. package/nationalarchives/components/checkboxes/fixtures.json +4 -0
  31. package/nationalarchives/components/checkboxes/macro-options.json +102 -0
  32. package/nationalarchives/components/checkboxes/macro.njk +3 -0
  33. package/nationalarchives/components/checkboxes/template.njk +35 -0
  34. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -1
  35. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  36. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  37. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  38. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +2 -0
  39. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +11 -0
  40. package/nationalarchives/components/cookie-banner/fixtures.json +28 -9
  41. package/nationalarchives/components/cookie-banner/macro-options.json +12 -0
  42. package/nationalarchives/components/cookie-banner/template.njk +1 -1
  43. package/nationalarchives/components/date-input/_index.scss +1 -0
  44. package/nationalarchives/components/date-input/date-input.css +1 -0
  45. package/nationalarchives/components/date-input/date-input.css.map +1 -0
  46. package/nationalarchives/components/date-input/date-input.scss +48 -0
  47. package/nationalarchives/components/date-input/date-input.stories.js +116 -0
  48. package/nationalarchives/components/date-input/fixtures.json +4 -0
  49. package/nationalarchives/components/date-input/macro-options.json +96 -0
  50. package/nationalarchives/components/date-input/macro.njk +3 -0
  51. package/nationalarchives/components/date-input/template.njk +45 -0
  52. package/nationalarchives/components/date-search/_index.scss +1 -0
  53. package/nationalarchives/components/date-search/date-search.css +1 -0
  54. package/nationalarchives/components/date-search/date-search.css.map +1 -0
  55. package/nationalarchives/components/date-search/date-search.scss +27 -0
  56. package/nationalarchives/components/date-search/date-search.stories.js +121 -0
  57. package/nationalarchives/components/date-search/fixtures.json +4 -0
  58. package/nationalarchives/components/date-search/macro-options.json +94 -0
  59. package/nationalarchives/components/date-search/macro.njk +3 -0
  60. package/nationalarchives/components/date-search/template.njk +27 -0
  61. package/nationalarchives/components/featured-records/featured-records.css +1 -1
  62. package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
  63. package/nationalarchives/components/filters/filters.css +1 -1
  64. package/nationalarchives/components/filters/filters.css.map +1 -1
  65. package/nationalarchives/components/filters/filters.scss +0 -8
  66. package/nationalarchives/components/filters/template.njk +1 -1
  67. package/nationalarchives/components/footer/footer.css +1 -1
  68. package/nationalarchives/components/footer/footer.css.map +1 -1
  69. package/nationalarchives/components/footer/footer.scss +3 -5
  70. package/nationalarchives/components/footer/template.njk +10 -6
  71. package/nationalarchives/components/gallery/gallery.css +1 -1
  72. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  73. package/nationalarchives/components/gallery/gallery.scss +0 -11
  74. package/nationalarchives/components/gallery/gallery.stories.js +8 -10
  75. package/nationalarchives/components/gallery/template.njk +1 -1
  76. package/nationalarchives/components/grid/grid.css +1 -1
  77. package/nationalarchives/components/grid/grid.css.map +1 -1
  78. package/nationalarchives/components/header/header.css +1 -1
  79. package/nationalarchives/components/header/header.css.map +1 -1
  80. package/nationalarchives/components/header/header.scss +30 -29
  81. package/nationalarchives/components/header/header.stories.js +0 -41
  82. package/nationalarchives/components/header/template.njk +1 -1
  83. package/nationalarchives/components/hero/hero.css +1 -1
  84. package/nationalarchives/components/hero/hero.css.map +1 -1
  85. package/nationalarchives/components/hero/hero.scss +1 -5
  86. package/nationalarchives/components/index-grid/fixtures.json +324 -1
  87. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  88. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  89. package/nationalarchives/components/index-grid/index-grid.scss +13 -10
  90. package/nationalarchives/components/index-grid/index-grid.stories.js +24 -13
  91. package/nationalarchives/components/index-grid/macro-options.json +34 -29
  92. package/nationalarchives/components/index-grid/template.njk +13 -8
  93. package/nationalarchives/components/message/message.css +1 -1
  94. package/nationalarchives/components/message/message.css.map +1 -1
  95. package/nationalarchives/components/message/message.scss +1 -6
  96. package/nationalarchives/components/message/template.njk +1 -1
  97. package/nationalarchives/components/pagination/pagination.css +1 -1
  98. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  99. package/nationalarchives/components/pagination/template.njk +32 -17
  100. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  101. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  102. package/nationalarchives/components/phase-banner/phase-banner.scss +2 -3
  103. package/nationalarchives/components/picture/picture.css +1 -1
  104. package/nationalarchives/components/picture/picture.css.map +1 -1
  105. package/nationalarchives/components/picture/picture.js.map +1 -1
  106. package/nationalarchives/components/picture/picture.mjs +0 -4
  107. package/nationalarchives/components/picture/picture.scss +1 -1
  108. package/nationalarchives/components/picture/template.njk +1 -1
  109. package/nationalarchives/components/radios/_index.scss +1 -0
  110. package/nationalarchives/components/radios/fixtures.json +4 -0
  111. package/nationalarchives/components/radios/macro-options.json +102 -0
  112. package/nationalarchives/components/radios/macro.njk +3 -0
  113. package/nationalarchives/components/radios/radios.css +1 -0
  114. package/nationalarchives/components/radios/radios.css.map +1 -0
  115. package/nationalarchives/components/radios/radios.scss +131 -0
  116. package/nationalarchives/components/radios/radios.stories.js +241 -0
  117. package/nationalarchives/components/radios/template.njk +35 -0
  118. package/nationalarchives/components/search-field/_index.scss +1 -0
  119. package/nationalarchives/components/search-field/fixtures.json +4 -0
  120. package/nationalarchives/components/search-field/macro-options.json +68 -0
  121. package/nationalarchives/components/search-field/macro.njk +3 -0
  122. package/nationalarchives/components/search-field/search-field.css +1 -0
  123. package/nationalarchives/components/search-field/search-field.css.map +1 -0
  124. package/nationalarchives/components/search-field/search-field.scss +32 -0
  125. package/nationalarchives/components/search-field/search-field.stories.js +88 -0
  126. package/nationalarchives/components/search-field/template.njk +32 -0
  127. package/nationalarchives/components/select/_index.scss +1 -0
  128. package/nationalarchives/components/select/fixtures.json +4 -0
  129. package/nationalarchives/components/select/macro-options.json +114 -0
  130. package/nationalarchives/components/select/macro.njk +3 -0
  131. package/nationalarchives/components/select/select.css +1 -0
  132. package/nationalarchives/components/select/select.css.map +1 -0
  133. package/nationalarchives/components/select/select.scss +51 -0
  134. package/nationalarchives/components/select/select.stories.js +194 -0
  135. package/nationalarchives/components/select/template.njk +29 -0
  136. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  137. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  138. package/nationalarchives/components/sensitive-image/template.njk +1 -1
  139. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  140. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  141. package/nationalarchives/components/skip-link/template.njk +1 -1
  142. package/nationalarchives/components/tabs/tabs.css +1 -1
  143. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  144. package/nationalarchives/components/tabs/tabs.js +1 -1
  145. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  146. package/nationalarchives/components/tabs/tabs.mjs +1 -1
  147. package/nationalarchives/components/tabs/tabs.scss +11 -1
  148. package/nationalarchives/components/tabs/template.njk +1 -1
  149. package/nationalarchives/components/text-input/_index.scss +1 -0
  150. package/nationalarchives/components/text-input/fixtures.json +4 -0
  151. package/nationalarchives/components/text-input/macro-options.json +118 -0
  152. package/nationalarchives/components/text-input/macro.njk +3 -0
  153. package/nationalarchives/components/text-input/template.njk +30 -0
  154. package/nationalarchives/components/text-input/text-input.css +1 -0
  155. package/nationalarchives/components/text-input/text-input.css.map +1 -0
  156. package/nationalarchives/components/text-input/text-input.scss +44 -0
  157. package/nationalarchives/components/text-input/text-input.stories.js +188 -0
  158. package/nationalarchives/components/textarea/_index.scss +1 -0
  159. package/nationalarchives/components/textarea/fixtures.json +4 -0
  160. package/nationalarchives/components/textarea/macro-options.json +106 -0
  161. package/nationalarchives/components/textarea/macro.njk +3 -0
  162. package/nationalarchives/components/textarea/template.njk +27 -0
  163. package/nationalarchives/components/textarea/textarea.css +1 -0
  164. package/nationalarchives/components/textarea/textarea.css.map +1 -0
  165. package/nationalarchives/components/textarea/textarea.scss +45 -0
  166. package/nationalarchives/components/textarea/textarea.stories.js +127 -0
  167. package/nationalarchives/lib/cookies.mjs +7 -1
  168. package/nationalarchives/prototype-kit.css +2 -2
  169. package/nationalarchives/prototype-kit.css.map +1 -1
  170. package/nationalarchives/prototype-kit.scss +0 -8
  171. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +301 -31
  172. package/nationalarchives/stories/utilities/forms/forms.mdx +117 -0
  173. package/nationalarchives/stories/utilities/typography/typography.stories.js +0 -6
  174. package/nationalarchives/templates/layouts/_generic.njk +1 -1
  175. package/nationalarchives/tools/_colour.scss +48 -27
  176. package/nationalarchives/tools/_typography.scss +0 -1
  177. package/nationalarchives/utilities/_a11y.scss +6 -2
  178. package/nationalarchives/utilities/_colour.scss +10 -6
  179. package/nationalarchives/utilities/_debug.scss +3 -4
  180. package/nationalarchives/utilities/_forms.scss +93 -0
  181. package/nationalarchives/utilities/_index.scss +1 -0
  182. package/nationalarchives/utilities/_lists.scss +1 -1
  183. package/nationalarchives/utilities/_overrides.scss +1 -1
  184. package/nationalarchives/utilities/_typography.scss +66 -57
  185. package/nationalarchives/variables/_colour.scss +14 -10
  186. package/nationalarchives/variables/_forms.scss +2 -0
  187. package/nationalarchives/variables/_index.scss +1 -0
  188. package/nationalarchives/variables/_typography.scss +2 -2
  189. package/package.json +15 -15
  190. package/nationalarchives/stories/utilities/overrides/overrides.mdx +0 -53
@@ -6,11 +6,3 @@
6
6
  );
7
7
 
8
8
  @use "all";
9
-
10
- .tna-template__body {
11
- p {
12
- // color: inherit;
13
- // font-family: inherit;
14
- // font-weight: inherit;
15
- }
16
- }
@@ -2,6 +2,7 @@ import SkipLink from "../../../components/skip-link/template.njk";
2
2
  import Breadcrumbs from "../../../components/breadcrumbs/template.njk";
3
3
  import Button from "../../../components/button/template.njk";
4
4
  import Card from "../../../components/card/template.njk";
5
+ import Checkboxes from "../../../components/checkboxes/template.njk";
5
6
  import FeaturedRecords from "../../../components/featured-records/template.njk";
6
7
  import Footer from "../../../components/footer/template.njk";
7
8
  import CookieBanner from "../../../components/cookie-banner/template.njk";
@@ -13,7 +14,11 @@ import Message from "../../../components/message/template.njk";
13
14
  import Pagination from "../../../components/pagination/template.njk";
14
15
  import PhaseBanner from "../../../components/phase-banner/template.njk";
15
16
  import Picture from "../../../components/picture/template.njk";
17
+ import Radios from "../../../components/radios/template.njk";
18
+ import Select from "../../../components/select/template.njk";
16
19
  import Tabs from "../../../components/tabs/template.njk";
20
+ import TextInput from "../../../components/text-input/template.njk";
21
+ import Textarea from "../../../components/textarea/template.njk";
17
22
 
18
23
  const argTypes = {
19
24
  theme: {
@@ -28,7 +33,7 @@ const argTypes = {
28
33
  },
29
34
  accent: {
30
35
  control: "radio",
31
- options: ["none", "black", "yellow", "pink", "orange", "green", "blue"],
36
+ options: ["none", "yellow", "pink", "orange", "green", "blue"],
32
37
  },
33
38
  };
34
39
 
@@ -64,28 +69,26 @@ const Template = ({ theme, accent }) => {
64
69
  theme === "system"
65
70
  ? "tna-template--system-theme"
66
71
  : theme === "light"
67
- ? "tna-template--light-theme"
68
- : theme === "dark"
69
- ? "tna-template--dark-theme"
70
- : theme === "light high-contrast"
71
- ? "tna-template--light-theme tna-template--high-contrast-theme"
72
- : theme === "dark high-contrast"
73
- ? "tna-template--dark-theme tna-template--high-contrast-theme"
74
- : ""
72
+ ? "tna-template--light-theme"
73
+ : theme === "dark"
74
+ ? "tna-template--dark-theme"
75
+ : theme === "light high-contrast"
76
+ ? "tna-template--light-theme tna-template--high-contrast-theme"
77
+ : theme === "dark high-contrast"
78
+ ? "tna-template--dark-theme tna-template--high-contrast-theme"
79
+ : ""
75
80
  } ${
76
- accent === "black"
77
- ? "tna-template--black-accent"
78
- : accent === "yellow"
81
+ accent === "yellow"
79
82
  ? "tna-template--yellow-accent"
80
83
  : accent === "pink"
81
- ? "tna-template--pink-accent"
82
- : accent === "orange"
83
- ? "tna-template--orange-accent"
84
- : accent === "green"
85
- ? "tna-template--green-accent"
86
- : accent === "blue"
87
- ? "tna-template--blue-accent"
88
- : ""
84
+ ? "tna-template--pink-accent"
85
+ : accent === "orange"
86
+ ? "tna-template--orange-accent"
87
+ : accent === "green"
88
+ ? "tna-template--green-accent"
89
+ : accent === "blue"
90
+ ? "tna-template--blue-accent"
91
+ : ""
89
92
  }">
90
93
  <div class="tna-template__body tna-template__body--padded">
91
94
  <!--
@@ -258,7 +261,6 @@ const Template = ({ theme, accent }) => {
258
261
  params: {
259
262
  text: "Primary button",
260
263
  href: "#",
261
- classes: "tna-button--solid-hover",
262
264
  },
263
265
  })}
264
266
  </div>
@@ -615,7 +617,9 @@ const Template = ({ theme, accent }) => {
615
617
  <div class="tna-section">
616
618
  ${IndexGrid({
617
619
  params: {
618
- heading: { title: "My dogs 1", level: 3, href: "#" },
620
+ title: "My dogs 1",
621
+ headingLevel: 3,
622
+ headingHref: "#",
619
623
  items: Array(6)
620
624
  .fill({
621
625
  ...{
@@ -683,7 +687,7 @@ const Template = ({ theme, accent }) => {
683
687
  next: {
684
688
  href: "#",
685
689
  },
686
- classes: "tna-pagination--demo",
690
+ classes: "tna-pagination--demo tna-!--margin-top-m",
687
691
  },
688
692
  })}
689
693
  <div class="tna-button-group">
@@ -697,7 +701,9 @@ const Template = ({ theme, accent }) => {
697
701
  <div class="tna-section tna-background-tint">
698
702
  ${IndexGrid({
699
703
  params: {
700
- heading: { title: "My dogs 2", level: 3, href: "#" },
704
+ title: "My dogs 2",
705
+ headingLevel: 3,
706
+ headingHref: "#",
701
707
  items: Array(6)
702
708
  .fill({
703
709
  ...{
@@ -765,7 +771,7 @@ const Template = ({ theme, accent }) => {
765
771
  next: {
766
772
  href: "#",
767
773
  },
768
- classes: "tna-pagination--demo",
774
+ classes: "tna-pagination--demo tna-!--margin-top-m",
769
775
  },
770
776
  })}
771
777
  <div class="tna-button-group">
@@ -779,7 +785,9 @@ const Template = ({ theme, accent }) => {
779
785
  <div class="tna-section tna-background-contrast">
780
786
  ${IndexGrid({
781
787
  params: {
782
- heading: { title: "My dogs 3", level: 3, href: "#" },
788
+ title: "My dogs 3",
789
+ headingLevel: 3,
790
+ headingHref: "#",
783
791
  items: Array(6)
784
792
  .fill({
785
793
  ...{
@@ -847,7 +855,7 @@ const Template = ({ theme, accent }) => {
847
855
  next: {
848
856
  href: "#",
849
857
  },
850
- classes: "tna-pagination--demo",
858
+ classes: "tna-pagination--demo tna-!--margin-top-m",
851
859
  },
852
860
  })}
853
861
  <div class="tna-button-group">
@@ -861,7 +869,9 @@ const Template = ({ theme, accent }) => {
861
869
  <div class="tna-section tna-background-accent-light">
862
870
  ${IndexGrid({
863
871
  params: {
864
- heading: { title: "My dogs 4", level: 3, href: "#" },
872
+ title: "My dogs 4",
873
+ headingLevel: 3,
874
+ headingHref: "#",
865
875
  items: Array(6)
866
876
  .fill({
867
877
  ...{
@@ -929,7 +939,7 @@ const Template = ({ theme, accent }) => {
929
939
  next: {
930
940
  href: "#",
931
941
  },
932
- classes: "tna-pagination--demo",
942
+ classes: "tna-pagination--demo tna-!--margin-top-m",
933
943
  },
934
944
  })}
935
945
  <div class="tna-button-group">
@@ -943,7 +953,9 @@ const Template = ({ theme, accent }) => {
943
953
  <div class="tna-section tna-background-accent">
944
954
  ${IndexGrid({
945
955
  params: {
946
- heading: { title: "My dogs 5", level: 3, href: "#" },
956
+ title: "My dogs 5",
957
+ headingLevel: 3,
958
+ headingHref: "#",
947
959
  items: Array(6)
948
960
  .fill({
949
961
  ...{
@@ -1011,7 +1023,7 @@ const Template = ({ theme, accent }) => {
1011
1023
  next: {
1012
1024
  href: "#",
1013
1025
  },
1014
- classes: "tna-pagination--demo",
1026
+ classes: "tna-pagination--demo tna-!--margin-top-m",
1015
1027
  },
1016
1028
  })}
1017
1029
  <div class="tna-button-group">
@@ -1022,6 +1034,123 @@ const Template = ({ theme, accent }) => {
1022
1034
  </div>
1023
1035
  </div>
1024
1036
  </div>
1037
+ <div class="tna-section">
1038
+ <div class="tna-container">
1039
+ <div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny">
1040
+ <form>
1041
+ <h2 class="tna-heading tna-heading--l">
1042
+ Forms
1043
+ </h2>
1044
+ ${TextInput({
1045
+ params: {
1046
+ label: "Enter your name",
1047
+ headingLevel: 3,
1048
+ headingSize: "m",
1049
+ id: "name",
1050
+ name: "name",
1051
+ autofill: "name",
1052
+ },
1053
+ })}
1054
+ ${TextInput({
1055
+ params: {
1056
+ label: "Enter your email",
1057
+ headingLevel: 3,
1058
+ headingSize: "m",
1059
+ id: "email",
1060
+ name: "email",
1061
+ autofill: "email",
1062
+ },
1063
+ })}
1064
+ ${Select({
1065
+ params: {
1066
+ label: "Sort by",
1067
+ headingLevel: 3,
1068
+ headingSize: "m",
1069
+ id: "sort",
1070
+ name: "sort",
1071
+ items: [
1072
+ {
1073
+ text: "Relevance",
1074
+ value: "relevance",
1075
+ },
1076
+ {
1077
+ text: "Date",
1078
+ value: "date",
1079
+ },
1080
+ {
1081
+ text: "Title",
1082
+ value: "title",
1083
+ },
1084
+ ],
1085
+ },
1086
+ })}
1087
+ ${Radios({
1088
+ params: {
1089
+ label: "Type",
1090
+ headingLevel: 3,
1091
+ headingSize: "m",
1092
+ id: "type",
1093
+ name: "type",
1094
+ items: [
1095
+ {
1096
+ text: "Audio",
1097
+ value: "audio",
1098
+ },
1099
+ {
1100
+ text: "Image",
1101
+ value: "image",
1102
+ },
1103
+ {
1104
+ text: "Video",
1105
+ value: "video",
1106
+ },
1107
+ ],
1108
+ },
1109
+ })}
1110
+ ${Checkboxes({
1111
+ params: {
1112
+ label: "Categories",
1113
+ headingLevel: 3,
1114
+ headingSize: "m",
1115
+ id: "categories",
1116
+ name: "categories",
1117
+ items: [
1118
+ {
1119
+ text: "Alpha",
1120
+ value: "alpha",
1121
+ },
1122
+ {
1123
+ text: "Beta",
1124
+ value: "beta",
1125
+ },
1126
+ {
1127
+ text: "Gamma",
1128
+ value: "gamma",
1129
+ },
1130
+ ],
1131
+ },
1132
+ })}
1133
+ ${Textarea({
1134
+ params: {
1135
+ label: "Enter your feedback",
1136
+ headingLevel: 3,
1137
+ headingSize: "m",
1138
+ id: "feedback",
1139
+ name: "feedback",
1140
+ },
1141
+ })}
1142
+ <div class="tna-button-group">
1143
+ <button type="button" class="tna-button">
1144
+ Submit
1145
+ </button>
1146
+ <a href="#" class="tna-button tna-button--plain">
1147
+ Skip
1148
+ </a>
1149
+ </div>
1150
+ </form>
1151
+ </div>
1152
+ </div>
1153
+ </div>
1025
1154
  </main>
1026
1155
  ${Footer({
1027
1156
  params: {
@@ -1204,3 +1333,144 @@ DarkHighContrast.args = {
1204
1333
  theme: "dark high-contrast",
1205
1334
  accent: "pink",
1206
1335
  };
1336
+
1337
+ const CombinationsTemplate = () => {
1338
+ const themes = [
1339
+ "tna-template--light-theme",
1340
+ "tna-template--light-theme tna-template--high-contrast-theme",
1341
+ "tna-template--dark-theme",
1342
+ "tna-template--dark-theme tna-template--high-contrast-theme",
1343
+ ];
1344
+
1345
+ const accents = [
1346
+ "",
1347
+ // "tna-template--black-accent",
1348
+ "tna-template--yellow-accent",
1349
+ "tna-template--pink-accent",
1350
+ "tna-template--orange-accent",
1351
+ "tna-template--green-accent",
1352
+ "tna-template--blue-accent",
1353
+ ];
1354
+
1355
+ const blocks = [
1356
+ "",
1357
+ "tna-background-tint",
1358
+ "tna-background-accent-light",
1359
+ "tna-background-accent",
1360
+ "tna-background-contrast",
1361
+ ];
1362
+
1363
+ return `<div class="tna-colour-contrast-demo">
1364
+ <div class="tna-colour-contrast-demo__header">
1365
+ <div class="tna-colour-contrast-demo__block">
1366
+ Blocks
1367
+ </div>
1368
+ ${blocks.reduce(
1369
+ (blockOutput, block) =>
1370
+ `${blockOutput}<div class="tna-colour-contrast-demo__block">
1371
+ ${block.replace(/^tna-background-/, "") || "Base"}
1372
+ </div>`,
1373
+ "",
1374
+ )}
1375
+ </div>
1376
+ <div class="tna-colour-contrast-demo__examples">
1377
+ ${themes.reduce(
1378
+ (themeOutput, theme) =>
1379
+ `${themeOutput}${accents.reduce(
1380
+ (
1381
+ accentOutput,
1382
+ accent,
1383
+ ) => `${accentOutput}<div class="tna-colour-contrast-demo__theme-accent">
1384
+ <div class="tna-colour-contrast-demo__example">
1385
+ <p>Theme: <strong>${theme
1386
+ .replace(/tna-template--/g, "")
1387
+ .replace(/-theme/g, "")}</strong></p>
1388
+ <p>Accent: <strong>${
1389
+ accent.replace(/tna-template--/g, "").replace(/-accent/g, "") ||
1390
+ "[none]"
1391
+ }</strong></p>
1392
+ </div>
1393
+ ${blocks.reduce(
1394
+ (blockOutput, block) =>
1395
+ `${blockOutput}<div class="tna-colour-contrast-demo__example tna-template ${theme} ${accent}">
1396
+ <div class="tna-template__body">
1397
+ <div class="tna-colour-contrast-demo__example-content ${block}">
1398
+ <p>Text</p>
1399
+ <p><a href="#"><strong>Link</strong></a> / <a href="#" class="tna-colour-contrast-demo__link--visited"><strong>Link (visited)</strong></a></p>
1400
+ <span class="tna-chip">Chip</span>
1401
+ <div class="tna-button-group">
1402
+ ${Button({
1403
+ params: {
1404
+ text: "Button",
1405
+ small: true,
1406
+ },
1407
+ })}
1408
+ ${Button({
1409
+ params: {
1410
+ text: "Button",
1411
+ small: true,
1412
+ accent: true,
1413
+ },
1414
+ })}
1415
+ ${Button({
1416
+ params: {
1417
+ text: "Button",
1418
+ small: true,
1419
+ plain: true,
1420
+ },
1421
+ })}
1422
+ <!--${Button({
1423
+ params: {
1424
+ text: "Button",
1425
+ accent: true,
1426
+ class: "tna-button--solid-hover",
1427
+ },
1428
+ })}-->
1429
+ </div>
1430
+ <!--${Pagination({
1431
+ params: {
1432
+ previous: {
1433
+ href: "#",
1434
+ },
1435
+ items: [
1436
+ {
1437
+ number: 1,
1438
+ href: "#",
1439
+ },
1440
+ {
1441
+ ellipsis: true,
1442
+ },
1443
+ {
1444
+ number: 7,
1445
+ current: true,
1446
+ href: "#",
1447
+ },
1448
+ {
1449
+ ellipsis: true,
1450
+ },
1451
+ {
1452
+ number: 42,
1453
+ href: "#",
1454
+ },
1455
+ ],
1456
+ next: {
1457
+ href: "#",
1458
+ },
1459
+ },
1460
+ })}-->
1461
+ </div>
1462
+ </div>
1463
+ </div>`,
1464
+ "",
1465
+ )}
1466
+ </div>`,
1467
+ "",
1468
+ )}`,
1469
+ "",
1470
+ )}
1471
+ </div>
1472
+ </div>`;
1473
+ };
1474
+
1475
+ export const Combinations = CombinationsTemplate.bind({});
1476
+ Combinations.args = {};
@@ -0,0 +1,117 @@
1
+ import { Meta, Canvas } from "@storybook/blocks";
2
+ import * as TextInputStories from "../../../components/text-input/text-input.stories";
3
+ import * as TextareaStories from "../../../components/textarea/textarea.stories";
4
+ import * as DateInputStories from "../../../components/date-input/date-input.stories";
5
+ import * as DateSearchStories from "../../../components/date-search/date-search.stories";
6
+ import * as SelectStories from "../../../components/select/select.stories";
7
+ import * as RadiosStories from "../../../components/radios/radios.stories";
8
+ import * as CheckboxesStories from "../../../components/checkboxes/checkboxes.stories";
9
+ import * as SearchFieldStories from "../../../components/search-field/search-field.stories";
10
+
11
+ <Meta title="Utilities/Form elements" />
12
+
13
+ # Form elements
14
+
15
+ <Canvas of={TextInputStories.Standard} />
16
+ <Canvas of={TextareaStories.Standard} />
17
+ <Canvas of={SelectStories.Standard} />
18
+ <Canvas of={RadiosStories.Standard} />
19
+ <Canvas of={RadiosStories.Small} />
20
+ <Canvas of={CheckboxesStories.Standard} />
21
+ <Canvas of={CheckboxesStories.Small} />
22
+ <Canvas of={DateSearchStories.Standard} />
23
+ <Canvas of={DateInputStories.Standard} />
24
+ <Canvas of={SearchFieldStories.Standard} />
25
+
26
+ ## Inline
27
+
28
+ <Canvas of={TextInputStories.Inline} />
29
+ <Canvas of={TextareaStories.Inline} />
30
+ <Canvas of={SelectStories.Inline} />
31
+ <Canvas of={RadiosStories.Inline} />
32
+ <Canvas of={CheckboxesStories.Inline} />
33
+ <Canvas of={DateSearchStories.Inline} />
34
+ <Canvas of={DateInputStories.Inline} />
35
+
36
+ ## Structure
37
+
38
+ ### Single form elements
39
+
40
+ ```html
41
+ <div class="tna-form__group"> <!-- Optional: "tna-form__group--error" -->
42
+
43
+ <div class="tna-form__group-contents">
44
+
45
+ <h4 class="tna-form__heading tna-form__heading--m">
46
+ <label class="tna-form__label" for="tna-form__ELEMENT-ID">
47
+ <!-- Field title -->
48
+ </label>
49
+ </h4>
50
+
51
+ <!-- Optional hint
52
+ <p id="tna-form__ELEMENT-ID-hint" class="tna-form__hint">
53
+ [Hint text]
54
+ </p>
55
+ -->
56
+
57
+ <!-- Optional error
58
+ <p id="tna-form__ELEMENT-ID-error" class="tna-form__error-message">
59
+ <span class="tna-!--visually-hidden">Error:</span> [Error text]
60
+ </p>
61
+ -->
62
+
63
+ </div>
64
+
65
+ <!-- Field id="tna-form__ELEMENT-ID"
66
+ If hint:
67
+ aria-describedby="tna-form__ELEMENT-ID-hint"
68
+ If error:
69
+ aria-describedby="tna-form__ELEMENT-ID-error"
70
+ If hint and error:
71
+ aria-describedby="tna-form__ELEMENT-ID-hint tna-form__ELEMENT-ID-error"
72
+ -->
73
+
74
+ </div>
75
+ ```
76
+
77
+ ### Fieldset (multiple inputs - e.g. checkboxes and radios)
78
+
79
+ ```html
80
+ <div class="tna-form__group"> <!-- Optional: "tna-form__group--error" -->
81
+
82
+ <fieldset class="tna-form__fieldset"><!-- Fieldset
83
+ If hint:
84
+ aria-describedby="tna-form__ELEMENT-ID-hint"
85
+ If error:
86
+ aria-describedby="tna-form__ELEMENT-ID-error"
87
+ If hint and error:
88
+ aria-describedby="tna-form__ELEMENT-ID-hint tna-form__ELEMENT-ID-error"
89
+ -->
90
+
91
+ <div class="tna-form__group-contents">
92
+
93
+ <legend class="tna-form__legend">
94
+ <h4 class="tna-form__heading tna-form__heading--m">
95
+ <!-- Field title -->
96
+ </h4>
97
+ </legend>
98
+
99
+ <!-- Optional hint
100
+ <p id="tna-form__ELEMENT-ID-hint" class="tna-form__hint">
101
+ [Hint text]
102
+ </p>
103
+ -->
104
+
105
+ <!-- Optional error
106
+ <p id="tna-form__ELEMENT-ID-error" class="tna-form__error-message">
107
+ <span class="tna-!--visually-hidden">Error:</span> [Error text]
108
+ </p>
109
+ -->
110
+
111
+ </div>
112
+ </fieldset>
113
+
114
+ <!-- Fields -->
115
+
116
+ </div>
117
+ ```
@@ -57,12 +57,6 @@ SceneSetterSmall.args = {
57
57
  text: `We are the official archive of England and Wales. Discover 1,000 years of history through <a href="#">fascinating stories</a> from the past or <a href="#">start your own research</a> and <a href="#">search our catalogue</a> of 32 million records. <a href="#">Plan a visit</a> to access original historic documents from our collections then enjoy the grounds, café, and <a href="#">free exhibitions</a>.`,
58
58
  };
59
59
 
60
- // const TextDetailsTemplate = () =>
61
- // `<p>
62
- // Typed slip with photographs - 'The <span class="tna-detail" title="Italian (miscellaneous)" data-type="misc">Italian</span> Steamer <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> which ran on the rocks near <span class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</span> a few days ago is now a total wreck. After a severe buffeting by heavy seas the ship has broken in two. The photograph shows the <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> broken in two by a severe buffeting from the seas near <a href="#" class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</a>.
63
- // </p>`;
64
- // export const TextDetails = TextDetailsTemplate.bind({});
65
-
66
60
  const BlockquoteTemplate = ({
67
61
  html,
68
62
  author,
@@ -28,7 +28,7 @@
28
28
  <link rel="stylesheet" type="text/css" href="https://use.typekit.net/hkj3kuz.css">
29
29
  {% endblock %}
30
30
  </head>
31
- <body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
31
+ <body class="tna-template__body {{ bodyClasses }}"{% for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
32
32
  {% block bodyStart %}
33
33
  {% block cookies %}
34
34
  {{ tnaCookieBanner({