@nationalarchives/frontend 0.1.65 → 0.2.0

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 (205) hide show
  1. package/config/.eslintrc.js +1 -1
  2. package/config/.htmlvalidate.json +12 -5
  3. package/config/stylelint.config.js +1 -0
  4. package/nationalarchives/all.css +1 -1
  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 +0 -18
  9. package/nationalarchives/components/_forms.scss +9 -0
  10. package/nationalarchives/components/_index.scss +2 -35
  11. package/nationalarchives/components/_presentation.scss +23 -0
  12. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  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 +9 -9
  17. package/nationalarchives/components/card/card.css +1 -1
  18. package/nationalarchives/components/card/card.css.map +1 -1
  19. package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
  20. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  21. package/nationalarchives/components/checkboxes/checkboxes.njk +1 -1
  22. package/nationalarchives/components/checkboxes/checkboxes.scss +1 -1
  23. package/nationalarchives/components/checkboxes/macro-options.json +6 -0
  24. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  25. package/nationalarchives/components/date-input/date-input.css +1 -1
  26. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  27. package/nationalarchives/components/date-input/date-input.scss +2 -2
  28. package/nationalarchives/components/date-input/fixtures.json +5 -5
  29. package/nationalarchives/components/date-input/template.njk +1 -1
  30. package/nationalarchives/components/date-search/date-search.css +1 -1
  31. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  32. package/nationalarchives/components/date-search/date-search.scss +2 -2
  33. package/nationalarchives/components/details/details.css.map +1 -1
  34. package/nationalarchives/components/error-summary/error-summary.css +1 -1
  35. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  36. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  37. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  38. package/nationalarchives/components/error-summary/error-summary.mjs +1 -1
  39. package/nationalarchives/components/error-summary/error-summary.scss +3 -4
  40. package/nationalarchives/components/files-list/_index.scss +1 -0
  41. package/nationalarchives/components/files-list/files-list.css +1 -0
  42. package/nationalarchives/components/files-list/files-list.css.map +1 -0
  43. package/nationalarchives/components/{files/files.scss → files-list/files-list.scss} +2 -1
  44. package/nationalarchives/components/files-list/fixtures.json +71 -0
  45. package/nationalarchives/components/files-list/macro.njk +3 -0
  46. package/nationalarchives/components/files-list/template.njk +33 -0
  47. package/nationalarchives/components/footer/footer.css.map +1 -1
  48. package/nationalarchives/components/gallery/fixtures.json +1 -1
  49. package/nationalarchives/components/gallery/gallery.css +1 -1
  50. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  51. package/nationalarchives/components/gallery/gallery.scss +5 -6
  52. package/nationalarchives/components/gallery/template.njk +11 -7
  53. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  54. package/nationalarchives/components/header/header.css.map +1 -1
  55. package/nationalarchives/components/hero/hero.css +1 -1
  56. package/nationalarchives/components/hero/hero.css.map +1 -1
  57. package/nationalarchives/components/hero/hero.scss +0 -24
  58. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  59. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  60. package/nationalarchives/components/index-grid/index-grid.scss +1 -1
  61. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  62. package/nationalarchives/components/picture/picture.css.map +1 -1
  63. package/nationalarchives/components/quick-filters/quick-filters.css +1 -1
  64. package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
  65. package/nationalarchives/components/radios/radios.css +1 -1
  66. package/nationalarchives/components/radios/radios.css.map +1 -1
  67. package/nationalarchives/components/radios/radios.scss +1 -1
  68. package/nationalarchives/components/records-list/_index.scss +1 -0
  69. package/nationalarchives/components/records-list/fixtures.json +42 -0
  70. package/nationalarchives/components/records-list/macro.njk +3 -0
  71. package/nationalarchives/components/records-list/records-list.css +1 -0
  72. package/nationalarchives/components/records-list/records-list.css.map +1 -0
  73. package/nationalarchives/components/{featured-records/featured-records.scss → records-list/records-list.scss} +1 -1
  74. package/nationalarchives/components/records-list/template.njk +21 -0
  75. package/nationalarchives/components/search-field/search-field.css +1 -1
  76. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  77. package/nationalarchives/components/search-field/search-field.scss +1 -1
  78. package/nationalarchives/components/select/select.css +1 -1
  79. package/nationalarchives/components/select/select.css.map +1 -1
  80. package/nationalarchives/components/select/select.scss +2 -2
  81. package/nationalarchives/components/sidebar/fixtures.json +12 -2
  82. package/nationalarchives/components/sidebar/sidebar.css +1 -1
  83. package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
  84. package/nationalarchives/components/sidebar/template.njk +9 -0
  85. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  86. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  87. package/nationalarchives/components/text-input/text-input.css +1 -1
  88. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  89. package/nationalarchives/components/text-input/text-input.scss +2 -2
  90. package/nationalarchives/components/textarea/textarea.css +1 -1
  91. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  92. package/nationalarchives/components/textarea/textarea.scss +2 -2
  93. package/nationalarchives/components/warning/warning.css +1 -1
  94. package/nationalarchives/components/warning/warning.css.map +1 -1
  95. package/nationalarchives/components/warning/warning.scss +1 -0
  96. package/nationalarchives/global-header-package.css +1 -1
  97. package/nationalarchives/global-header-package.css.map +1 -1
  98. package/nationalarchives/global-header-package.scss +1 -1
  99. package/nationalarchives/print.css +1 -1
  100. package/nationalarchives/print.css.map +1 -1
  101. package/nationalarchives/prototype-kit.css +1 -1
  102. package/nationalarchives/prototype-kit.css.map +1 -1
  103. package/nationalarchives/tools/_colour.scss +25 -50
  104. package/nationalarchives/utilities/_columns.scss +1 -1
  105. package/nationalarchives/utilities/_index.scss +1 -0
  106. package/nationalarchives/utilities/_reset.scss +2 -8
  107. package/nationalarchives/utilities/{_colour.scss → colour/_index.scss} +2 -2
  108. package/nationalarchives/utilities/{_forms.scss → forms/_index.scss} +6 -6
  109. package/nationalarchives/utilities/grid/macro.njk +3 -0
  110. package/nationalarchives/utilities/{_lists.scss → lists/_index.scss} +16 -7
  111. package/nationalarchives/utilities/{_overrides.scss → overrides/_index.scss} +2 -2
  112. package/nationalarchives/utilities/{_tables.scss → tables/_index.scss} +5 -5
  113. package/nationalarchives/utilities/{_typography.scss → typography/_index.scss} +5 -5
  114. package/nationalarchives/variables/_colour.scss +12 -5
  115. package/package.json +1 -1
  116. package/nationalarchives/components/accordion/accordion.stories.js +0 -432
  117. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +0 -128
  118. package/nationalarchives/components/button/button-group.stories.js +0 -114
  119. package/nationalarchives/components/button/button.stories.js +0 -207
  120. package/nationalarchives/components/card/card.stories.js +0 -402
  121. package/nationalarchives/components/checkboxes/checkboxes.stories.js +0 -241
  122. package/nationalarchives/components/compound-filters/compound-filters.stories.js +0 -61
  123. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +0 -250
  124. package/nationalarchives/components/date-input/date-input.stories.js +0 -119
  125. package/nationalarchives/components/date-search/date-search.stories.js +0 -124
  126. package/nationalarchives/components/details/details.stories.js +0 -33
  127. package/nationalarchives/components/error-summary/error-summary.stories.js +0 -59
  128. package/nationalarchives/components/featured-records/_index.scss +0 -1
  129. package/nationalarchives/components/featured-records/featured-records.css +0 -1
  130. package/nationalarchives/components/featured-records/featured-records.css.map +0 -1
  131. package/nationalarchives/components/featured-records/featured-records.stories.js +0 -50
  132. package/nationalarchives/components/featured-records/fixtures.json +0 -42
  133. package/nationalarchives/components/featured-records/macro.njk +0 -3
  134. package/nationalarchives/components/featured-records/template.njk +0 -21
  135. package/nationalarchives/components/files/_index.scss +0 -1
  136. package/nationalarchives/components/files/files.css +0 -1
  137. package/nationalarchives/components/files/files.css.map +0 -1
  138. package/nationalarchives/components/files/files.stories.js +0 -59
  139. package/nationalarchives/components/files/fixtures.json +0 -71
  140. package/nationalarchives/components/files/macro.njk +0 -3
  141. package/nationalarchives/components/files/template.njk +0 -33
  142. package/nationalarchives/components/footer/footer.stories.js +0 -241
  143. package/nationalarchives/components/gallery/gallery.stories.js +0 -87
  144. package/nationalarchives/components/global-header/global-header.stories.js +0 -364
  145. package/nationalarchives/components/grid/_index.scss +0 -1
  146. package/nationalarchives/components/grid/grid.css +0 -1
  147. package/nationalarchives/components/grid/grid.css.map +0 -1
  148. package/nationalarchives/components/grid/grid.stories.js +0 -279
  149. package/nationalarchives/components/grid/macro.njk +0 -3
  150. package/nationalarchives/components/header/header.stories.js +0 -239
  151. package/nationalarchives/components/hero/hero.stories.js +0 -326
  152. package/nationalarchives/components/index-grid/index-grid.stories.js +0 -128
  153. package/nationalarchives/components/pagination/pagination.stories.js +0 -532
  154. package/nationalarchives/components/phase-banner/phase-banner.stories.js +0 -39
  155. package/nationalarchives/components/picture/picture.stories.js +0 -75
  156. package/nationalarchives/components/quick-filters/quick-filters.stories.js +0 -76
  157. package/nationalarchives/components/radios/radios.stories.js +0 -244
  158. package/nationalarchives/components/search-field/search-field.stories.js +0 -88
  159. package/nationalarchives/components/search-filters/_index.scss +0 -1
  160. package/nationalarchives/components/search-filters/fixtures.json +0 -16
  161. package/nationalarchives/components/search-filters/macro-options.json +0 -39
  162. package/nationalarchives/components/search-filters/macro.njk +0 -3
  163. package/nationalarchives/components/search-filters/search-filters.css +0 -1
  164. package/nationalarchives/components/search-filters/search-filters.css.map +0 -1
  165. package/nationalarchives/components/search-filters/search-filters.js +0 -2
  166. package/nationalarchives/components/search-filters/search-filters.js.map +0 -1
  167. package/nationalarchives/components/search-filters/search-filters.mjs +0 -67
  168. package/nationalarchives/components/search-filters/search-filters.scss +0 -198
  169. package/nationalarchives/components/search-filters/search-filters.stories.js +0 -207
  170. package/nationalarchives/components/search-filters/template.njk +0 -108
  171. package/nationalarchives/components/select/select.stories.js +0 -197
  172. package/nationalarchives/components/sensitive-image/_index.scss +0 -1
  173. package/nationalarchives/components/sensitive-image/fixtures.json +0 -51
  174. package/nationalarchives/components/sensitive-image/macro-options.json +0 -58
  175. package/nationalarchives/components/sensitive-image/macro.njk +0 -3
  176. package/nationalarchives/components/sensitive-image/sensitive-image.css +0 -1
  177. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +0 -1
  178. package/nationalarchives/components/sensitive-image/sensitive-image.js +0 -2
  179. package/nationalarchives/components/sensitive-image/sensitive-image.js.map +0 -1
  180. package/nationalarchives/components/sensitive-image/sensitive-image.mjs +0 -23
  181. package/nationalarchives/components/sensitive-image/sensitive-image.scss +0 -85
  182. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +0 -86
  183. package/nationalarchives/components/sensitive-image/template.njk +0 -11
  184. package/nationalarchives/components/sidebar/sidebar.stories.js +0 -227
  185. package/nationalarchives/components/skip-link/skip-link.stories.js +0 -76
  186. package/nationalarchives/components/tabs/tabs.stories.js +0 -300
  187. package/nationalarchives/components/text-input/text-input.stories.js +0 -188
  188. package/nationalarchives/components/textarea/textarea.stories.js +0 -130
  189. package/nationalarchives/components/warning/warning.stories.js +0 -39
  190. package/nationalarchives/stories/intro.mdx +0 -13
  191. package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +0 -293
  192. package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +0 -1513
  193. package/nationalarchives/stories/utilities/forms/forms.mdx +0 -117
  194. package/nationalarchives/stories/utilities/lists/lists.stories.js +0 -212
  195. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +0 -42
  196. package/nationalarchives/stories/utilities/tables/tables.stories.js +0 -47
  197. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +0 -94
  198. package/nationalarchives/stories/utilities/typography/headings.stories.js +0 -33
  199. package/nationalarchives/stories/utilities/typography/typography.stories.js +0 -91
  200. package/nationalarchives/components/{files → files-list}/macro-options.json +0 -0
  201. package/nationalarchives/components/{featured-records → records-list}/macro-options.json +0 -0
  202. package/nationalarchives/{components/grid/grid.scss → utilities/grid/_index.scss} +1 -1
  203. /package/nationalarchives/{components → utilities}/grid/fixtures.json +0 -0
  204. /package/nationalarchives/{components → utilities}/grid/macro-options.json +0 -0
  205. /package/nationalarchives/{components → utilities}/grid/template.njk +0 -0
@@ -1,117 +0,0 @@
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="ELEMENT-ID">
47
- <!-- Field title -->
48
- </label>
49
- </h4>
50
-
51
- <!-- Optional hint
52
- <p id="ELEMENT-ID-hint" class="tna-form__hint">
53
- [Hint text]
54
- </p>
55
- -->
56
-
57
- <!-- Optional error
58
- <p id="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="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="ELEMENT-ID-hint" class="tna-form__hint">
101
- [Hint text]
102
- </p>
103
- -->
104
-
105
- <!-- Optional error
106
- <p id="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
- ```
@@ -1,212 +0,0 @@
1
- const argTypes = {
2
- items: { control: "object" },
3
- plain: { control: "boolean" },
4
- classes: { control: "text" },
5
- };
6
-
7
- export default {
8
- title: "Utilities/Lists",
9
- argTypes,
10
- };
11
-
12
- const UnorderedListTemplate = ({ items, style, classes = "" }) =>
13
- `<ul class="tna-ul${style ? ` tna-ul--${style}` : ""} ${classes}">${items.reduce(
14
- (list, item) => `${list}<li>${item}</li>`,
15
- "",
16
- )}</ul>`;
17
- export const UnorderedList = UnorderedListTemplate.bind({});
18
- UnorderedList.parameters = {
19
- chromatic: { disableSnapshot: true },
20
- };
21
- UnorderedList.args = {
22
- items: ["Alpha", "Beta", "Gamma"],
23
- };
24
- export const UnorderedListPlain = UnorderedListTemplate.bind({});
25
- UnorderedListPlain.parameters = {
26
- chromatic: { disableSnapshot: true },
27
- };
28
- UnorderedListPlain.args = {
29
- items: ["Alpha", "Beta", "Gamma"],
30
- style: "plain",
31
- };
32
- export const UnorderedListDashed = UnorderedListTemplate.bind({});
33
- UnorderedListDashed.parameters = {
34
- chromatic: { disableSnapshot: true },
35
- };
36
- UnorderedListDashed.args = {
37
- items: ["Alpha", "Beta", "Gamma"],
38
- style: "dashed",
39
- };
40
-
41
- const OrderedListTemplate = ({ items, style, classes = "" }) =>
42
- `<ol class="tna-ol${style ? ` tna-ol--${style}` : ""} ${classes}">${items.reduce(
43
- (list, item) => `${list}<li>${item}</li>`,
44
- "",
45
- )}</ol>`;
46
- export const OrderedList = OrderedListTemplate.bind({});
47
- OrderedList.parameters = {
48
- chromatic: { disableSnapshot: true },
49
- };
50
- OrderedList.args = {
51
- items: ["Alpha", "Beta", "Gamma"],
52
- };
53
- export const OrderedListPlain = OrderedListTemplate.bind({});
54
- OrderedListPlain.parameters = {
55
- chromatic: { disableSnapshot: true },
56
- };
57
- OrderedListPlain.args = {
58
- items: ["Alpha", "Beta", "Gamma"],
59
- style: "plain",
60
- };
61
- export const OrderedListDashed = OrderedListTemplate.bind({});
62
- OrderedListDashed.parameters = {
63
- chromatic: { disableSnapshot: true },
64
- };
65
- OrderedListDashed.args = {
66
- items: ["Alpha", "Beta", "Gamma"],
67
- style: "dashed",
68
- };
69
- export const OrderedListNested = OrderedListTemplate.bind({});
70
- OrderedListNested.parameters = {
71
- chromatic: { disableSnapshot: true },
72
- };
73
- OrderedListNested.args = {
74
- items: ["Alpha", "Beta", "Gamma", "Delta"],
75
- style: "dashed",
76
- };
77
-
78
- const DescriptionListTemplate = ({ items, plain, classes = "" }) =>
79
- `<dl class="tna-dl${plain ? " tna-dl--plain" : ""}${
80
- items.some((item) => item.icon) ? " tna-dl--icon-padding" : ""
81
- } ${classes}">${items.reduce(
82
- (list, item) => `${list}
83
- <dt>
84
- ${
85
- item.icon
86
- ? `<i class="fa-solid fa-${item.icon}" aria-hidden="true"></i>`
87
- : ""
88
- }
89
- ${item.title}
90
- </dt>
91
- ${
92
- Array.isArray(item.description)
93
- ? item.description.reduce(
94
- (descriptions, description) =>
95
- `${descriptions}<dd>${description}</dd>`,
96
- "",
97
- )
98
- : `<dd>${item.description}</dd>`
99
- }`,
100
- "",
101
- )}
102
- </dl>`;
103
-
104
- export const DescriptionList = DescriptionListTemplate.bind({});
105
- DescriptionList.parameters = {
106
- chromatic: { disableSnapshot: true },
107
- };
108
- DescriptionList.args = {
109
- items: [
110
- { title: "Alpha", description: "Lorem ipsum" },
111
- { title: "Beta", description: "Lorem ipsum" },
112
- { title: "Gamma", description: "Lorem ipsum" },
113
- { title: "Delta", description: "Lorem ipsum" },
114
- { title: "Epsilon", description: "Lorem ipsum" },
115
- { title: "Zeta", description: "Lorem ipsum" },
116
- { title: "Eta", description: "Lorem ipsum" },
117
- ],
118
- };
119
-
120
- export const PlainDescriptionList = DescriptionListTemplate.bind({});
121
- PlainDescriptionList.parameters = {
122
- chromatic: { disableSnapshot: true },
123
- };
124
- PlainDescriptionList.args = {
125
- items: [
126
- { title: "Alpha", description: "Lorem ipsum" },
127
- { title: "Beta", description: "Lorem ipsum" },
128
- { title: "Gamma", description: "Lorem ipsum" },
129
- { title: "Delta", description: "Lorem ipsum" },
130
- ],
131
- plain: true,
132
- };
133
-
134
- export const DescriptionListWithIcons = DescriptionListTemplate.bind({});
135
- DescriptionListWithIcons.parameters = {
136
- chromatic: { disableSnapshot: true },
137
- };
138
- DescriptionListWithIcons.args = {
139
- items: [
140
- {
141
- title: "Held by",
142
- description: "The National Archives, Kew",
143
- icon: "landmark",
144
- },
145
- { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
146
- { title: "Reference", description: "LC 4", icon: "database" },
147
- ],
148
- };
149
-
150
- export const PlainDescriptionListWithIcons = DescriptionListTemplate.bind({});
151
- PlainDescriptionListWithIcons.parameters = {
152
- chromatic: { disableSnapshot: true },
153
- };
154
- PlainDescriptionListWithIcons.args = {
155
- items: [
156
- {
157
- title: "Held by",
158
- description: "The National Archives, Kew",
159
- icon: "landmark",
160
- },
161
- { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
162
- { title: "Reference", description: "LC 4", icon: "database" },
163
- ],
164
- plain: true,
165
- };
166
-
167
- export const ComplexDescriptionList = DescriptionListTemplate.bind({});
168
- ComplexDescriptionList.parameters = {
169
- chromatic: { disableSnapshot: true },
170
- };
171
- ComplexDescriptionList.args = {
172
- items: [
173
- { title: "Alpha", description: "Lorem ipsum" },
174
- { title: "Beta", description: "Lorem ipsum" },
175
- {
176
- title: "Gamma",
177
- description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
178
- },
179
- {
180
- title: "Delta",
181
- description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
182
- },
183
- { title: "Epsilon", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
184
- { title: "Zeta", description: "Lorem ipsum" },
185
- { title: "Eta", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
186
- ],
187
- };
188
-
189
- const ChipListTemplate = ({ items, plain, classes = "" }) =>
190
- `<dl class="tna-dl-chips${plain ? " tna-dl-chips--plain" : ""} ${classes}">${items.reduce(
191
- (list, item) => `${list}
192
- <dt>${item.title}</dt>
193
- <dd>
194
- <${item.href ? "a" : "span"} class="tna-dl-chips__item">
195
- ${item.icon ? `<i class="fa-solid fa-${item.icon}" aria-hidden="true"></i>` : ""}
196
- ${item.text}
197
- </${item.href ? "a" : "span"}>
198
- </dd>`,
199
- "",
200
- )}</dl>`;
201
- export const ChipList = ChipListTemplate.bind({});
202
- ChipList.parameters = {
203
- chromatic: { disableSnapshot: true },
204
- };
205
- ChipList.args = {
206
- items: [
207
- { title: "Published", text: "Saturday 28 June 2014", icon: "calendar" },
208
- { title: "Author", text: "James Cronan", icon: "user", href: "#" },
209
- { title: "Category", text: "Records and research", href: "#" },
210
- { title: "Comments", text: "3 comments" },
211
- ],
212
- };
@@ -1,42 +0,0 @@
1
- import { customViewports } from "../../../../../.storybook/viewports";
2
-
3
- const argTypes = {};
4
-
5
- export default {
6
- title: "Utilities/Overrides",
7
- argTypes,
8
- };
9
-
10
- const Template = () => {
11
- return `<div class="tna-spacing-demo">
12
- <p>Lorem ipsum</p>
13
- <p class="tna-!--no-margin-top">Lorem ipsum (tna-!--no-margin-top)</p>
14
- <p class="tna-!--margin-top-xs">Lorem ipsum (tna-!--margin-top-xs)</p>
15
- <p class="tna-!--margin-top-s">Lorem ipsum (tna-!--margin-top-s)</p>
16
- <p class="tna-!--margin-top-m">Lorem ipsum (tna-!--margin-top-m)</p>
17
- <p class="tna-!--margin-top-l">Lorem ipsum (tna-!--margin-top-l)</p>
18
- <p class="tna-!--margin-top-xl">Lorem ipsum (tna-!--margin-top-xl)</p>
19
- <p class="tna-!--margin-top-xxl">Lorem ipsum (tna-!--margin-top-xxl)</p>
20
- </div>`;
21
- };
22
-
23
- export const Margin = Template.bind({});
24
- Margin.parameters = {
25
- chromatic: { disableSnapshot: true },
26
- };
27
- Margin.args = {};
28
-
29
- export const MarginMobile = Template.bind({});
30
- MarginMobile.parameters = {
31
- chromatic: { disableSnapshot: true },
32
- };
33
- MarginMobile.parameters = {
34
- viewport: {
35
- defaultViewport: "small",
36
- },
37
- chromatic: {
38
- viewports: [customViewports["small"].styles.width.replace(/px$/, "")],
39
- disableSnapshot: true,
40
- },
41
- };
42
- MarginMobile.args = {};
@@ -1,47 +0,0 @@
1
- export default {
2
- title: "Utilities/Tables",
3
- };
4
-
5
- const TableTemplate = () =>
6
- `<table class="tna-table">
7
- <caption class="tna-table__caption">
8
- Records added and removed between 2020 and 2022.
9
- </caption>
10
- <thead class="tna-table__head">
11
- <tr class="tna-table__row">
12
- <th class="tna-table__header" scope="col">Year</th>
13
- <th class="tna-table__header" scope="col">Chinese zodiac sign</th>
14
- <th class="tna-table__header tna-table__header--numeric" scope="col">Records added</th>
15
- <th class="tna-table__header tna-table__header--numeric" scope="col">Size (megabytes)</th>
16
- </tr>
17
- </thead>
18
- <tbody class="tna-table__body">
19
- <tr>
20
- <th class="tna-table__header" scope="row">2020</th>
21
- <td class="tna-table__cell">Rat</td>
22
- <td class="tna-table__cell tna-table__cell--numeric">123,456</td>
23
- <td class="tna-table__cell tna-table__cell--numeric">789</td>
24
- </tr>
25
- <tr>
26
- <th class="tna-table__header" scope="row">2021</th>
27
- <td class="tna-table__cell">Ox</td>
28
- <td class="tna-table__cell tna-table__cell--numeric">456,789</td>
29
- <td class="tna-table__cell tna-table__cell--numeric">123</td>
30
- </tr>
31
- <tr>
32
- <th class="tna-table__header" scope="row">2022</th>
33
- <td class="tna-table__cell">Tiger</td>
34
- <td class="tna-table__cell tna-table__cell--numeric">42,424</td>
35
- <td class="tna-table__cell tna-table__cell--numeric">1,337</td>
36
- </tr>
37
- </tbody>
38
- <tfoot class="tna-table__foot">
39
- <tr>
40
- <th class="tna-table__header" scope="row">Totals</th>
41
- <td class="tna-table__cell"></td>
42
- <td class="tna-table__cell tna-table__cell--numeric">622,669</td>
43
- <td class="tna-table__cell tna-table__cell--numeric">2,249</td>
44
- </tr>
45
- </tfoot>
46
- </table>`;
47
- export const Table = TableTemplate.bind({});
@@ -1,94 +0,0 @@
1
- const argTypes = {
2
- supertitle: { control: "text" },
3
- title: { control: "text" },
4
- level: { control: "number", min: 1, max: 6, step: 1 },
5
- size: { control: "radio", options: ["m", "l", "xl"] },
6
- plainSupertitle: { control: "boolean" },
7
- };
8
-
9
- export default {
10
- title: "Utilities/Typography",
11
- argTypes,
12
- };
13
-
14
- const HeadingGroupTemplate = ({
15
- supertitle,
16
- title,
17
- level,
18
- size,
19
- plainSupertitle,
20
- }) =>
21
- `<hgroup class="tna-hgroup-${size}">
22
- <p class="tna-hgroup__supertitle${
23
- plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
24
- }">${supertitle}</p>
25
- <h${level} class="tna-hgroup__title">${title}</h${level}>
26
- </hgroup>`;
27
-
28
- export const HeadingGroup = HeadingGroupTemplate.bind({});
29
- HeadingGroup.parameters = {
30
- chromatic: { disableSnapshot: true },
31
- };
32
- HeadingGroup.args = {
33
- supertitle: "Record revealed",
34
- title: "The Monteagle Letter",
35
- level: 3,
36
- size: "l",
37
- plainSupertitle: false,
38
- };
39
-
40
- const HeadingGroupSingleSentenceTemplate = ({
41
- supertitle,
42
- title,
43
- level,
44
- size,
45
- plainSupertitle,
46
- }) =>
47
- `<hgroup class="tna-hgroup-${size}">
48
- <h${level} class="tna-hgroup__title">
49
- <span class="tna-hgroup__supertitle${
50
- plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
51
- }">${supertitle}</span>
52
- <span class="tna-hgroup__title">${title}</span>
53
- </h${level}>
54
- </hgroup>`;
55
-
56
- export const HeadingGroupSingleSentence =
57
- HeadingGroupSingleSentenceTemplate.bind({});
58
- HeadingGroupSingleSentence.parameters = {
59
- chromatic: { disableSnapshot: true },
60
- };
61
- HeadingGroupSingleSentence.args = {
62
- supertitle: "The story of",
63
- title: "Alice Hawkins",
64
- level: 3,
65
- size: "l",
66
- plainSupertitle: false,
67
- };
68
-
69
- const HeadingGroupPlainSupertitleTemplate = ({
70
- supertitle,
71
- title,
72
- level,
73
- size,
74
- plainSupertitle,
75
- }) =>
76
- `<hgroup class="tna-hgroup-${size}">
77
- <p class="tna-hgroup__supertitle${
78
- plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
79
- }">${supertitle}</p>
80
- <h${level} class="tna-hgroup__title">${title}</h${level}>
81
- </hgroup>`;
82
-
83
- export const HeadingGroupPlainSupertitle =
84
- HeadingGroupPlainSupertitleTemplate.bind({});
85
- HeadingGroupPlainSupertitle.parameters = {
86
- chromatic: { disableSnapshot: true },
87
- };
88
- HeadingGroupPlainSupertitle.args = {
89
- supertitle: "Record revealed",
90
- title: "The Monteagle Letter",
91
- level: 3,
92
- size: "l",
93
- plainSupertitle: true,
94
- };
@@ -1,33 +0,0 @@
1
- const argTypes = {
2
- text: { control: "text" },
3
- size: { control: "text" },
4
- };
5
-
6
- export default {
7
- title: "Utilities/Typography",
8
- argTypes,
9
- };
10
-
11
- const HeadingTemplate = ({ params }, level) => `<h${level} class="tna-heading-${
12
- params.size
13
- }">
14
- ${params.text} (${params.size.toUpperCase()})
15
- </h${level}>
16
- `;
17
-
18
- const HeadingsTemplate = ({ text }) =>
19
- `${HeadingTemplate({ params: { text, size: "xl" } }, 1)}${HeadingTemplate(
20
- { params: { text, size: "l" } },
21
- 2,
22
- )}${HeadingTemplate({ params: { text, size: "m" } }, 3)}${HeadingTemplate(
23
- { params: { text, size: "s" } },
24
- 4,
25
- )}`;
26
-
27
- export const Headings = HeadingsTemplate.bind({});
28
- Headings.parameters = {
29
- chromatic: { disableSnapshot: true },
30
- };
31
- Headings.args = {
32
- text: "This is a heading",
33
- };
@@ -1,91 +0,0 @@
1
- const argTypes = {
2
- text: { control: "text" },
3
- };
4
-
5
- export default {
6
- title: "Utilities/Typography",
7
- argTypes,
8
- };
9
-
10
- const ParagraphTemplate = ({ paragraphs }) =>
11
- paragraphs.map((paragraph) => `<p>${paragraph}</p>`).join("");
12
- export const Paragraph = ParagraphTemplate.bind({});
13
- Paragraph.parameters = {
14
- chromatic: { disableSnapshot: true },
15
- };
16
- Paragraph.args = {
17
- paragraphs: [
18
- "This is some body text.",
19
- "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. Donec ac tellus in dui rutrum maximus. Aliquam vel euismod eros. Integer ut magna velit. Fusce sed dui sit amet metus eleifend dictum quis vitae mi. Aenean sagittis euismod purus, in accumsan metus venenatis nec. Nullam nec velit felis. Sed nec felis eu nisl varius dictum eu quis nisl. Donec dapibus est arcu, vel pellentesque risus pellentesque eget.",
20
- "Nam a posuere lectus. Vivamus facilisis est pretium augue aliquet iaculis. Phasellus ligula orci, commodo eget lectus et, tincidunt scelerisque erat. Aliquam in est vel purus ultricies vulputate non sed ligula. Pellentesque ut felis ullamcorper, eleifend erat dapibus, feugiat metus. Phasellus vitae dolor commodo, posuere nisl sed, luctus mauris. Etiam malesuada tincidunt enim, ac fermentum est pulvinar id. Maecenas id accumsan libero. Curabitur at velit nisi. Nullam gravida mauris quam, tempor pharetra risus venenatis vel. Proin quis malesuada lacus. Nulla condimentum facilisis turpis, et elementum leo. Nulla gravida quam mauris, id scelerisque est rhoncus ac.",
21
- ],
22
- };
23
-
24
- const LargeParagraphTemplate = ({ paragraphs }) =>
25
- paragraphs
26
- .map((paragraph) => `<p class="tna-large-paragraph">${paragraph}</p>`)
27
- .join("");
28
- export const LargeParagraph = LargeParagraphTemplate.bind({});
29
- LargeParagraph.parameters = {
30
- chromatic: { disableSnapshot: true },
31
- };
32
- LargeParagraph.args = {
33
- paragraphs: [
34
- "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. Donec ac tellus in dui rutrum maximus. Aliquam vel euismod eros. Integer ut magna velit. Fusce sed dui sit amet metus eleifend dictum quis vitae mi. Aenean sagittis euismod purus, in accumsan metus venenatis nec. Nullam nec velit felis. Sed nec felis eu nisl varius dictum eu quis nisl. Donec dapibus est arcu, vel pellentesque risus pellentesque eget.",
35
- ],
36
- };
37
-
38
- const HeadingLinkTemplate = ({ text, href }) =>
39
- `<h2 class="tna-heading-s">
40
- <a href="${href}">${text}</a>
41
- </h2>`;
42
- export const HeadingLink = HeadingLinkTemplate.bind({});
43
- HeadingLink.parameters = {
44
- chromatic: { disableSnapshot: true },
45
- };
46
- HeadingLink.args = {
47
- text: "Researching with The National Archives",
48
- href: "#",
49
- };
50
-
51
- const SceneSetterTemplate = ({ text }) =>
52
- `<p class="tna-scene-setter">
53
- ${text}
54
- </p>`;
55
- export const SceneSetter = SceneSetterTemplate.bind({});
56
- SceneSetter.parameters = {
57
- chromatic: { disableSnapshot: true },
58
- };
59
- SceneSetter.args = {
60
- 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>.`,
61
- };
62
-
63
- const SceneSetterSmallTemplate = ({ text }) =>
64
- `<p class="tna-scene-setter tna-scene-setter--small">
65
- ${text}
66
- </p>`;
67
- export const SceneSetterSmall = SceneSetterSmallTemplate.bind({});
68
- SceneSetterSmall.parameters = {
69
- chromatic: { disableSnapshot: true },
70
- };
71
- SceneSetterSmall.args = {
72
- 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>.`,
73
- };
74
-
75
- const BlockquoteTemplate = ({
76
- html,
77
- author,
78
- }) => `<blockquote class="tna-blockquote">
79
- <div class="tna-blockquote__quote">
80
- ${html}
81
- </div>
82
- <p class="tna-blockquote__citation">${author}</p>
83
- </blockquote>`;
84
- export const Blockquote = BlockquoteTemplate.bind({});
85
- Blockquote.parameters = {
86
- chromatic: { disableSnapshot: true },
87
- };
88
- Blockquote.args = {
89
- html: "<p>A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.</p>",
90
- author: "Douglas Adams, Mostly Harmless",
91
- };
@@ -1,7 +1,7 @@
1
1
  @use "sass:math";
2
2
  @use "../../variables/grid" as gridVars;
3
- @use "../../tools/media";
4
3
  @use "../../tools/grid";
4
+ @use "../../tools/media";
5
5
 
6
6
  .tna-container {
7
7
  width: 100%;