@nationalarchives/frontend 0.1.64 → 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 (270) hide show
  1. package/config/.babelrc.json +19 -0
  2. package/config/.eslintrc.js +25 -0
  3. package/config/.htmlvalidate.json +17 -0
  4. package/config/stylelint.config.js +240 -0
  5. package/nationalarchives/all.css +1 -3
  6. package/nationalarchives/all.css.map +1 -1
  7. package/nationalarchives/all.js +1 -1
  8. package/nationalarchives/all.js.map +1 -1
  9. package/nationalarchives/all.mjs +34 -18
  10. package/nationalarchives/all.scss +0 -2
  11. package/nationalarchives/components/_forms.scss +9 -0
  12. package/nationalarchives/components/_index.scss +2 -34
  13. package/nationalarchives/components/_presentation.scss +23 -0
  14. package/nationalarchives/components/accordion/accordion.css +1 -1
  15. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  16. package/nationalarchives/components/accordion/accordion.js +1 -1
  17. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  18. package/nationalarchives/components/accordion/accordion.mjs +92 -24
  19. package/nationalarchives/components/accordion/accordion.scss +56 -18
  20. package/nationalarchives/components/accordion/fixtures.json +34 -7
  21. package/nationalarchives/components/accordion/macro-options.json +14 -2
  22. package/nationalarchives/components/accordion/template.njk +7 -5
  23. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  24. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  25. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +0 -10
  26. package/nationalarchives/components/breadcrumbs/template.njk +1 -1
  27. package/nationalarchives/components/button/button.css +1 -1
  28. package/nationalarchives/components/button/button.css.map +1 -1
  29. package/nationalarchives/components/button/button.scss +32 -10
  30. package/nationalarchives/components/button/macro-options.json +6 -0
  31. package/nationalarchives/components/button/template.njk +3 -1
  32. package/nationalarchives/components/card/card.css +1 -1
  33. package/nationalarchives/components/card/card.css.map +1 -1
  34. package/nationalarchives/components/card/template.njk +5 -5
  35. package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
  36. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  37. package/nationalarchives/components/checkboxes/checkboxes.njk +1 -1
  38. package/nationalarchives/components/checkboxes/checkboxes.scss +1 -1
  39. package/nationalarchives/components/checkboxes/macro-options.json +6 -0
  40. package/nationalarchives/components/checkboxes/template.njk +1 -1
  41. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  42. package/nationalarchives/components/compound-filters/template.njk +1 -1
  43. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -1
  44. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  45. package/nationalarchives/components/cookie-banner/cookie-banner.scss +0 -2
  46. package/nationalarchives/components/cookie-banner/template.njk +1 -2
  47. package/nationalarchives/components/date-input/date-input.css +1 -1
  48. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  49. package/nationalarchives/components/date-input/date-input.scss +2 -2
  50. package/nationalarchives/components/date-input/fixtures.json +5 -5
  51. package/nationalarchives/components/date-input/template.njk +2 -2
  52. package/nationalarchives/components/date-search/date-search.css +1 -1
  53. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  54. package/nationalarchives/components/date-search/date-search.njk +2 -2
  55. package/nationalarchives/components/date-search/date-search.scss +2 -2
  56. package/nationalarchives/components/date-search/template.njk +1 -1
  57. package/nationalarchives/components/details/details.css.map +1 -1
  58. package/nationalarchives/components/details/template.njk +1 -1
  59. package/nationalarchives/components/error-summary/error-summary.css +1 -1
  60. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  61. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  62. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  63. package/nationalarchives/components/error-summary/error-summary.mjs +1 -1
  64. package/nationalarchives/components/error-summary/error-summary.scss +3 -4
  65. package/nationalarchives/components/error-summary/template.njk +1 -1
  66. package/nationalarchives/components/files-list/_index.scss +1 -0
  67. package/nationalarchives/components/files-list/files-list.css +1 -0
  68. package/nationalarchives/components/files-list/files-list.css.map +1 -0
  69. package/nationalarchives/components/files-list/files-list.scss +80 -0
  70. package/nationalarchives/components/files-list/fixtures.json +71 -0
  71. package/nationalarchives/components/{sensitive-image → files-list}/macro-options.json +20 -20
  72. package/nationalarchives/components/files-list/macro.njk +3 -0
  73. package/nationalarchives/components/files-list/template.njk +33 -0
  74. package/nationalarchives/components/footer/footer.css +1 -1
  75. package/nationalarchives/components/footer/footer.css.map +1 -1
  76. package/nationalarchives/components/footer/footer.scss +0 -2
  77. package/nationalarchives/components/footer/macro-options.json +0 -6
  78. package/nationalarchives/components/footer/template.njk +1 -1
  79. package/nationalarchives/components/gallery/fixtures.json +35 -1
  80. package/nationalarchives/components/gallery/gallery.css +1 -1
  81. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  82. package/nationalarchives/components/gallery/gallery.js +1 -1
  83. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  84. package/nationalarchives/components/gallery/gallery.mjs +192 -53
  85. package/nationalarchives/components/gallery/gallery.scss +317 -56
  86. package/nationalarchives/components/gallery/macro-options.json +34 -49
  87. package/nationalarchives/components/gallery/template.njk +74 -33
  88. package/nationalarchives/components/global-header/global-header.css +1 -1
  89. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  90. package/nationalarchives/components/global-header/global-header.scss +0 -2
  91. package/nationalarchives/components/global-header/template.njk +1 -1
  92. package/nationalarchives/components/header/header.css +1 -1
  93. package/nationalarchives/components/header/header.css.map +1 -1
  94. package/nationalarchives/components/header/header.scss +3 -5
  95. package/nationalarchives/components/header/template.njk +1 -1
  96. package/nationalarchives/components/hero/hero.css +1 -1
  97. package/nationalarchives/components/hero/hero.css.map +1 -1
  98. package/nationalarchives/components/hero/hero.scss +0 -24
  99. package/nationalarchives/components/hero/template.njk +1 -1
  100. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  101. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  102. package/nationalarchives/components/index-grid/index-grid.scss +1 -1
  103. package/nationalarchives/components/index-grid/template.njk +3 -3
  104. package/nationalarchives/components/pagination/pagination.css +1 -1
  105. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  106. package/nationalarchives/components/pagination/pagination.scss +1 -1
  107. package/nationalarchives/components/pagination/template.njk +1 -1
  108. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  109. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  110. package/nationalarchives/components/phase-banner/phase-banner.scss +0 -2
  111. package/nationalarchives/components/phase-banner/template.njk +1 -1
  112. package/nationalarchives/components/picture/picture.css.map +1 -1
  113. package/nationalarchives/components/picture/picture.js +1 -1
  114. package/nationalarchives/components/picture/picture.js.map +1 -1
  115. package/nationalarchives/components/picture/picture.mjs +2 -2
  116. package/nationalarchives/components/picture/template.njk +1 -1
  117. package/nationalarchives/components/quick-filters/quick-filters.css +1 -1
  118. package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
  119. package/nationalarchives/components/quick-filters/template.njk +1 -1
  120. package/nationalarchives/components/radios/radios.css +1 -1
  121. package/nationalarchives/components/radios/radios.css.map +1 -1
  122. package/nationalarchives/components/radios/radios.njk +1 -1
  123. package/nationalarchives/components/radios/radios.scss +1 -1
  124. package/nationalarchives/components/radios/template.njk +1 -1
  125. package/nationalarchives/components/records-list/_index.scss +1 -0
  126. package/nationalarchives/components/records-list/fixtures.json +42 -0
  127. package/nationalarchives/components/records-list/macro.njk +3 -0
  128. package/nationalarchives/components/records-list/records-list.css +1 -0
  129. package/nationalarchives/components/records-list/records-list.css.map +1 -0
  130. package/nationalarchives/components/{featured-records/featured-records.scss → records-list/records-list.scss} +2 -2
  131. package/nationalarchives/components/records-list/template.njk +21 -0
  132. package/nationalarchives/components/search-field/search-field.css +1 -1
  133. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  134. package/nationalarchives/components/search-field/search-field.scss +3 -2
  135. package/nationalarchives/components/search-field/template.njk +2 -2
  136. package/nationalarchives/components/select/select.css +1 -1
  137. package/nationalarchives/components/select/select.css.map +1 -1
  138. package/nationalarchives/components/select/select.scss +2 -2
  139. package/nationalarchives/components/select/template.njk +2 -2
  140. package/nationalarchives/components/sidebar/fixtures.json +18 -8
  141. package/nationalarchives/components/sidebar/macro-options.json +9 -2
  142. package/nationalarchives/components/sidebar/sidebar.css +1 -1
  143. package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
  144. package/nationalarchives/components/sidebar/template.njk +12 -3
  145. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  146. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  147. package/nationalarchives/components/skip-link/skip-link.scss +0 -2
  148. package/nationalarchives/components/skip-link/template.njk +1 -1
  149. package/nationalarchives/components/tabs/tabs.css +1 -1
  150. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  151. package/nationalarchives/components/tabs/tabs.scss +0 -12
  152. package/nationalarchives/components/tabs/template.njk +1 -1
  153. package/nationalarchives/components/text-input/template.njk +1 -1
  154. package/nationalarchives/components/text-input/text-input.css +1 -1
  155. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  156. package/nationalarchives/components/text-input/text-input.njk +2 -2
  157. package/nationalarchives/components/text-input/text-input.scss +2 -2
  158. package/nationalarchives/components/textarea/template.njk +2 -2
  159. package/nationalarchives/components/textarea/textarea.css +1 -1
  160. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  161. package/nationalarchives/components/textarea/textarea.scss +2 -2
  162. package/nationalarchives/components/warning/template.njk +1 -1
  163. package/nationalarchives/components/warning/warning.css +1 -1
  164. package/nationalarchives/components/warning/warning.css.map +1 -1
  165. package/nationalarchives/components/warning/warning.scss +2 -0
  166. package/nationalarchives/global-header-package.css +1 -1
  167. package/nationalarchives/global-header-package.css.map +1 -1
  168. package/nationalarchives/global-header-package.scss +1 -1
  169. package/nationalarchives/print.css +6 -0
  170. package/nationalarchives/print.css.map +1 -0
  171. package/nationalarchives/print.scss +44 -0
  172. package/nationalarchives/prototype-kit.css +1 -3
  173. package/nationalarchives/prototype-kit.css.map +1 -1
  174. package/nationalarchives/templates/layouts/_generic.njk +6 -6
  175. package/nationalarchives/tools/_a11y.scss +4 -0
  176. package/nationalarchives/tools/_colour.scss +75 -79
  177. package/nationalarchives/tools/_media.scss +0 -10
  178. package/nationalarchives/utilities/_columns.scss +1 -1
  179. package/nationalarchives/utilities/_index.scss +1 -0
  180. package/nationalarchives/utilities/_reset.scss +2 -8
  181. package/nationalarchives/utilities/{_colour.scss → colour/_index.scss} +2 -2
  182. package/nationalarchives/utilities/{_forms.scss → forms/_index.scss} +6 -6
  183. package/nationalarchives/utilities/grid/macro.njk +3 -0
  184. package/nationalarchives/{components → utilities}/grid/template.njk +1 -1
  185. package/nationalarchives/utilities/{_lists.scss → lists/_index.scss} +16 -7
  186. package/nationalarchives/utilities/{_overrides.scss → overrides/_index.scss} +8 -2
  187. package/nationalarchives/utilities/{_tables.scss → tables/_index.scss} +5 -5
  188. package/nationalarchives/utilities/{_typography.scss → typography/_index.scss} +8 -5
  189. package/nationalarchives/variables/_colour.scss +12 -5
  190. package/package.json +1 -1
  191. package/nationalarchives/components/accordion/accordion.stories.js +0 -410
  192. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +0 -128
  193. package/nationalarchives/components/button/button-group.stories.js +0 -114
  194. package/nationalarchives/components/button/button.stories.js +0 -204
  195. package/nationalarchives/components/card/card.stories.js +0 -402
  196. package/nationalarchives/components/checkboxes/checkboxes.stories.js +0 -241
  197. package/nationalarchives/components/compound-filters/compound-filters.stories.js +0 -61
  198. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +0 -250
  199. package/nationalarchives/components/date-input/date-input.stories.js +0 -119
  200. package/nationalarchives/components/date-search/date-search.stories.js +0 -124
  201. package/nationalarchives/components/details/details.stories.js +0 -33
  202. package/nationalarchives/components/error-summary/error-summary.stories.js +0 -59
  203. package/nationalarchives/components/featured-records/_index.scss +0 -1
  204. package/nationalarchives/components/featured-records/featured-records.css +0 -1
  205. package/nationalarchives/components/featured-records/featured-records.css.map +0 -1
  206. package/nationalarchives/components/featured-records/featured-records.stories.js +0 -50
  207. package/nationalarchives/components/featured-records/fixtures.json +0 -42
  208. package/nationalarchives/components/featured-records/macro.njk +0 -3
  209. package/nationalarchives/components/featured-records/template.njk +0 -21
  210. package/nationalarchives/components/footer/footer.stories.js +0 -241
  211. package/nationalarchives/components/gallery/gallery.stories.js +0 -74
  212. package/nationalarchives/components/global-header/global-header.stories.js +0 -364
  213. package/nationalarchives/components/grid/_index.scss +0 -1
  214. package/nationalarchives/components/grid/grid.css +0 -1
  215. package/nationalarchives/components/grid/grid.css.map +0 -1
  216. package/nationalarchives/components/grid/grid.stories.js +0 -279
  217. package/nationalarchives/components/grid/macro.njk +0 -3
  218. package/nationalarchives/components/header/header.stories.js +0 -239
  219. package/nationalarchives/components/hero/hero.stories.js +0 -326
  220. package/nationalarchives/components/index-grid/index-grid.stories.js +0 -128
  221. package/nationalarchives/components/pagination/pagination.stories.js +0 -532
  222. package/nationalarchives/components/phase-banner/phase-banner.stories.js +0 -39
  223. package/nationalarchives/components/picture/picture.stories.js +0 -75
  224. package/nationalarchives/components/quick-filters/quick-filters.stories.js +0 -76
  225. package/nationalarchives/components/radios/radios.stories.js +0 -244
  226. package/nationalarchives/components/search-field/search-field.stories.js +0 -88
  227. package/nationalarchives/components/search-filters/_index.scss +0 -1
  228. package/nationalarchives/components/search-filters/fixtures.json +0 -16
  229. package/nationalarchives/components/search-filters/macro-options.json +0 -39
  230. package/nationalarchives/components/search-filters/macro.njk +0 -3
  231. package/nationalarchives/components/search-filters/search-filters.css +0 -1
  232. package/nationalarchives/components/search-filters/search-filters.css.map +0 -1
  233. package/nationalarchives/components/search-filters/search-filters.js +0 -2
  234. package/nationalarchives/components/search-filters/search-filters.js.map +0 -1
  235. package/nationalarchives/components/search-filters/search-filters.mjs +0 -67
  236. package/nationalarchives/components/search-filters/search-filters.scss +0 -198
  237. package/nationalarchives/components/search-filters/search-filters.stories.js +0 -207
  238. package/nationalarchives/components/search-filters/template.njk +0 -108
  239. package/nationalarchives/components/select/select.stories.js +0 -197
  240. package/nationalarchives/components/sensitive-image/_index.scss +0 -1
  241. package/nationalarchives/components/sensitive-image/fixtures.json +0 -51
  242. package/nationalarchives/components/sensitive-image/macro.njk +0 -3
  243. package/nationalarchives/components/sensitive-image/sensitive-image.css +0 -1
  244. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +0 -1
  245. package/nationalarchives/components/sensitive-image/sensitive-image.js +0 -2
  246. package/nationalarchives/components/sensitive-image/sensitive-image.js.map +0 -1
  247. package/nationalarchives/components/sensitive-image/sensitive-image.mjs +0 -23
  248. package/nationalarchives/components/sensitive-image/sensitive-image.scss +0 -85
  249. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +0 -86
  250. package/nationalarchives/components/sensitive-image/template.njk +0 -11
  251. package/nationalarchives/components/sidebar/sidebar.stories.js +0 -224
  252. package/nationalarchives/components/skip-link/skip-link.stories.js +0 -76
  253. package/nationalarchives/components/tabs/tabs.stories.js +0 -300
  254. package/nationalarchives/components/text-input/text-input.stories.js +0 -188
  255. package/nationalarchives/components/textarea/textarea.stories.js +0 -130
  256. package/nationalarchives/components/warning/warning.stories.js +0 -39
  257. package/nationalarchives/stories/intro.mdx +0 -13
  258. package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +0 -293
  259. package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +0 -1535
  260. package/nationalarchives/stories/utilities/forms/forms.mdx +0 -117
  261. package/nationalarchives/stories/utilities/lists/lists.stories.js +0 -212
  262. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +0 -42
  263. package/nationalarchives/stories/utilities/tables/tables.stories.js +0 -47
  264. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +0 -94
  265. package/nationalarchives/stories/utilities/typography/headings.stories.js +0 -33
  266. package/nationalarchives/stories/utilities/typography/typography.stories.js +0 -91
  267. package/nationalarchives/components/{featured-records → records-list}/macro-options.json +0 -0
  268. package/nationalarchives/{components/grid/grid.scss → utilities/grid/_index.scss} +3 -3
  269. /package/nationalarchives/{components → utilities}/grid/fixtures.json +0 -0
  270. /package/nationalarchives/{components → utilities}/grid/macro-options.json +0 -0
@@ -1,74 +0,0 @@
1
- import Gallery from "./template.njk";
2
- import macroOptions from "./macro-options.json";
3
-
4
- const argTypes = {
5
- heading: { control: "object" },
6
- items: { control: "object" },
7
- classes: { control: "text" },
8
- attributes: { control: "object" },
9
- };
10
-
11
- Object.keys(argTypes).forEach((argType) => {
12
- argTypes[argType].description = macroOptions.find(
13
- (option) => option.name === argType,
14
- )?.description;
15
- });
16
-
17
- export default {
18
- title: "Components/Gallery",
19
- argTypes,
20
- };
21
-
22
- const Template = ({ heading, items, classes, attributes }) =>
23
- Gallery({
24
- params: {
25
- heading,
26
- items,
27
- classes,
28
- attributes,
29
- },
30
- });
31
-
32
- export const Standard = Template.bind({});
33
- Standard.args = {
34
- heading: { title: "My gallery", level: 3 },
35
- items: Array(6)
36
- .fill({
37
- alt: "",
38
- width: "",
39
- height: "",
40
- })
41
- .map((item, index) => ({
42
- ...item,
43
- src: `https://picsum.photos/id/${index + 1}/${
44
- index % 3 === 0 ? "800/600" : index % 3 === 1 ? "600/600" : "600/800"
45
- }`,
46
- alt: `Photo ${index + 1}`,
47
- description: `Photo #${index + 1}`,
48
- tabs:
49
- index === 0
50
- ? [
51
- {
52
- id: "tab-1",
53
- title: "Transcript",
54
- body: "<p>TEST TRANSCRIPT</p>",
55
- },
56
- {
57
- id: "tab-2",
58
- title: "Translation",
59
- body: "<p>TEST TRANSLATION</p>",
60
- },
61
- ]
62
- : index === 1
63
- ? [
64
- {
65
- id: "tab-1",
66
- title: "Transcript",
67
- body: "<p>TEST TRANSCRIPT</p>",
68
- },
69
- ]
70
- : null,
71
- })),
72
-
73
- classes: "tna-gallery--demo",
74
- };
@@ -1,364 +0,0 @@
1
- import Header from "./template.njk";
2
- import macroOptions from "./macro-options.json";
3
- import { within, userEvent, expect } from "@storybook/test";
4
- import { customViewports } from "../../../../.storybook/viewports";
5
-
6
- const argTypes = {
7
- logo: { control: "object" },
8
- topNavigation: { control: "object" },
9
- navigation: { control: "object" },
10
- collapseOnMedium: { control: "boolean" },
11
- classes: { control: "text" },
12
- attributes: { control: "object" },
13
- };
14
-
15
- Object.keys(argTypes).forEach((argType) => {
16
- argTypes[argType].description = macroOptions.find(
17
- (option) => option.name === argType,
18
- )?.description;
19
- });
20
-
21
- export default {
22
- title: "Components/Global header",
23
- argTypes,
24
- parameters: {
25
- chromatic: { delay: 1000 },
26
- },
27
- };
28
-
29
- const Template = ({
30
- logo,
31
- topNavigation,
32
- navigation,
33
- collapseOnMedium,
34
- classes,
35
- attributes,
36
- }) =>
37
- Header({
38
- params: {
39
- logo,
40
- topNavigation,
41
- navigation,
42
- collapseOnMedium,
43
- classes,
44
- attributes,
45
- },
46
- });
47
-
48
- export const Standard = Template.bind({});
49
- Standard.args = {
50
- logo: {
51
- href: "#/",
52
- },
53
- topNavigation: [
54
- {
55
- text: "Search",
56
- href: "https://www.nationalarchives.gov.uk/search/",
57
- icon: "search",
58
- },
59
- {
60
- text: "Shop",
61
- href: "https://shop.nationalarchives.gov.uk/",
62
- icon: "shop",
63
- },
64
- {
65
- text: "Sign in",
66
- href: "#/sign-in",
67
- icon: "user",
68
- },
69
- ],
70
- navigation: [
71
- {
72
- text: "Visit",
73
- href: "https://www.nationalarchives.gov.uk/about/visit-us/",
74
- },
75
- {
76
- text: "What’s on",
77
- href: "https://www.nationalarchives.gov.uk/about/visit-us/whats-on/",
78
- },
79
- {
80
- text: "Explore the collection",
81
- href: "https://beta.nationalarchives.gov.uk/explore-the-collection/",
82
- },
83
- {
84
- text: "Help using the archive",
85
- href: "https://www.nationalarchives.gov.uk/help-with-your-research/",
86
- },
87
- {
88
- text: "Education",
89
- href: "https://www.nationalarchives.gov.uk/education/",
90
- },
91
- {
92
- text: "Professional guidance and services",
93
- href: "https://www.nationalarchives.gov.uk/professional-guidance-and-services/",
94
- },
95
- ],
96
- classes: "tna-global-header--demo",
97
- };
98
- Standard.play = async ({ canvasElement }) => {
99
- await new Promise((r) => setTimeout(r, 100));
100
-
101
- const $navigationItems = canvasElement.querySelector(
102
- `.tna-global-header__navigation`,
103
- );
104
- const $navigationToggle = canvasElement.querySelector(
105
- `.tna-global-header__navigation-button`,
106
- );
107
-
108
- await expect($navigationItems).toBeVisible();
109
- await expect($navigationToggle).not.toBeVisible();
110
- };
111
-
112
- export const Medium = Template.bind({});
113
- Medium.parameters = {
114
- viewport: {
115
- defaultViewport: "medium",
116
- },
117
- chromatic: {
118
- viewports: [customViewports["medium"].styles.width.replace(/px$/, "")],
119
- },
120
- };
121
- Medium.args = {
122
- logo: {
123
- strapline: "Design System",
124
- href: "#/",
125
- },
126
- topNavigation: [
127
- {
128
- text: "Search",
129
- href: "https://www.nationalarchives.gov.uk/search/",
130
- icon: "search",
131
- },
132
- {
133
- text: "Shop",
134
- href: "https://shop.nationalarchives.gov.uk/",
135
- icon: "shop",
136
- },
137
- {
138
- text: "Sign in",
139
- href: "#/sign-in",
140
- icon: "user",
141
- },
142
- ],
143
- navigation: [
144
- {
145
- text: "Visit",
146
- href: "https://www.nationalarchives.gov.uk/about/visit-us/",
147
- },
148
- {
149
- text: "What’s on",
150
- href: "https://www.nationalarchives.gov.uk/about/visit-us/whats-on/",
151
- },
152
- {
153
- text: "Explore the collection",
154
- href: "https://beta.nationalarchives.gov.uk/explore-the-collection/",
155
- },
156
- {
157
- text: "Help using the archive",
158
- href: "https://www.nationalarchives.gov.uk/help-with-your-research/",
159
- },
160
- {
161
- text: "Education",
162
- href: "https://www.nationalarchives.gov.uk/education/",
163
- },
164
- {
165
- text: "Professional guidance and services",
166
- href: "https://www.nationalarchives.gov.uk/professional-guidance-and-services/",
167
- },
168
- ],
169
- classes: "tna-global-header--demo",
170
- };
171
- Medium.play = async ({ canvasElement }) => {
172
- await new Promise((r) => setTimeout(r, 100));
173
-
174
- const $navigationItems = canvasElement.querySelector(
175
- `.tna-global-header__navigation`,
176
- );
177
- const $navigationToggle = canvasElement.querySelector(
178
- `.tna-global-header__navigation-button`,
179
- );
180
-
181
- await expect($navigationItems).toBeVisible();
182
- await expect($navigationToggle).not.toBeVisible();
183
- };
184
-
185
- export const MediumCollapsed = Template.bind({});
186
- MediumCollapsed.parameters = {
187
- viewport: {
188
- defaultViewport: "medium",
189
- },
190
- chromatic: {
191
- viewports: [customViewports["medium"].styles.width.replace(/px$/, "")],
192
- },
193
- };
194
- MediumCollapsed.args = {
195
- logo: {
196
- strapline: "Design System",
197
- href: "#/",
198
- },
199
- topNavigation: [
200
- {
201
- text: "Search",
202
- href: "https://www.nationalarchives.gov.uk/search/",
203
- icon: "search",
204
- },
205
- {
206
- text: "Shop",
207
- href: "https://shop.nationalarchives.gov.uk/",
208
- icon: "shop",
209
- },
210
- {
211
- text: "Sign in",
212
- href: "#/sign-in",
213
- icon: "user",
214
- },
215
- ],
216
- navigation: [
217
- {
218
- text: "Visit",
219
- href: "https://www.nationalarchives.gov.uk/about/visit-us/",
220
- },
221
- {
222
- text: "What’s on",
223
- href: "https://www.nationalarchives.gov.uk/about/visit-us/whats-on/",
224
- },
225
- {
226
- text: "Explore the collection",
227
- href: "https://beta.nationalarchives.gov.uk/explore-the-collection/",
228
- },
229
- {
230
- text: "Help using the archive",
231
- href: "https://www.nationalarchives.gov.uk/help-with-your-research/",
232
- },
233
- {
234
- text: "Education",
235
- href: "https://www.nationalarchives.gov.uk/education/",
236
- },
237
- {
238
- text: "Professional guidance and services",
239
- href: "https://www.nationalarchives.gov.uk/professional-guidance-and-services/",
240
- },
241
- ],
242
- collapseOnMedium: true,
243
- classes: "tna-global-header--demo",
244
- };
245
-
246
- export const Mobile = Template.bind({});
247
- Mobile.parameters = {
248
- viewport: {
249
- defaultViewport: "small",
250
- },
251
- chromatic: {
252
- viewports: [customViewports["small"].styles.width.replace(/px$/, "")],
253
- },
254
- };
255
- Mobile.args = {
256
- logo: {
257
- strapline: "Design System",
258
- href: "#/",
259
- },
260
- topNavigation: [
261
- {
262
- text: "Search",
263
- href: "https://www.nationalarchives.gov.uk/search/",
264
- icon: "search",
265
- },
266
- {
267
- text: "Shop",
268
- href: "https://shop.nationalarchives.gov.uk/",
269
- icon: "shop",
270
- },
271
- {
272
- text: "Sign in",
273
- href: "#/sign-in",
274
- icon: "user",
275
- },
276
- ],
277
- navigation: [
278
- {
279
- text: "Visit",
280
- href: "https://www.nationalarchives.gov.uk/about/visit-us/",
281
- },
282
- {
283
- text: "What’s on",
284
- href: "https://www.nationalarchives.gov.uk/about/visit-us/whats-on/",
285
- },
286
- {
287
- text: "Explore the collection",
288
- href: "https://beta.nationalarchives.gov.uk/explore-the-collection/",
289
- },
290
- {
291
- text: "Help using the archive",
292
- href: "https://www.nationalarchives.gov.uk/help-with-your-research/",
293
- },
294
- {
295
- text: "Education",
296
- href: "https://www.nationalarchives.gov.uk/education/",
297
- },
298
- {
299
- text: "Professional guidance and services",
300
- href: "https://www.nationalarchives.gov.uk/professional-guidance-and-services/",
301
- },
302
- ],
303
- classes: "tna-global-header--demo",
304
- };
305
- Mobile.play = async ({ args, canvasElement, step }) => {
306
- await new Promise((r) => setTimeout(r, 100));
307
-
308
- const canvas = within(canvasElement);
309
-
310
- const $navigationItems = canvasElement.querySelector(
311
- `.tna-global-header__navigation`,
312
- );
313
- const [$linkA, $linkB, $linkC] = args.navigation.map((navigationItem) =>
314
- canvas.getByText(navigationItem.text),
315
- );
316
- const $navigationToggle = canvasElement.querySelector(
317
- `.tna-global-header__navigation-button`,
318
- );
319
-
320
- await step("Initial load", async () => {
321
- await expect($navigationItems).not.toBeVisible();
322
- await expect($navigationToggle).toBeVisible();
323
- await expect($navigationToggle).toHaveAttribute("aria-expanded", "false");
324
- await expect($linkA).not.toBeVisible();
325
- await expect($linkB).not.toBeVisible();
326
- await expect($linkC).not.toBeVisible();
327
- });
328
-
329
- await step("Open the menu", async () => {
330
- await userEvent.click($navigationToggle);
331
- await expect($navigationItems).toBeVisible();
332
- await expect($navigationToggle).toBeVisible();
333
- await expect($navigationToggle).toHaveAttribute("aria-expanded", "true");
334
- await expect($linkA).toBeVisible();
335
- await expect($linkB).toBeVisible();
336
- await expect($linkC).toBeVisible();
337
- });
338
-
339
- await step("Close the menu", async () => {
340
- await userEvent.click($navigationToggle);
341
- await expect($navigationItems).not.toBeVisible();
342
- await expect($navigationToggle).toBeVisible();
343
- await expect($navigationToggle).toHaveAttribute("aria-expanded", "false");
344
- await expect($linkA).not.toBeVisible();
345
- await expect($linkB).not.toBeVisible();
346
- await expect($linkC).not.toBeVisible();
347
- });
348
-
349
- // await step("Open the menu", async () => {
350
- // await userEvent.click($navigationToggle);
351
- // });
352
-
353
- // TODO
354
- // await step("Press the escape key", async () => {
355
- // await expect($navigationItems).not.toBeVisible();
356
- // await expect($navigationToggle).toBeVisible();
357
- // await expect($navigationToggle).toHaveAttribute("aria-expanded", "false");
358
- // await expect($linkA).not.toBeVisible();
359
- // await expect($linkB).not.toBeVisible();
360
- // await expect($linkC).not.toBeVisible();
361
- // });
362
-
363
- $navigationToggle.blur();
364
- };
@@ -1 +0,0 @@
1
- @use "grid";
@@ -1 +0,0 @@
1
- .tna-container{width:100%;max-width:1280px;margin-right:auto;margin-left:auto;padding-right:16px;padding-left:16px;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;box-sizing:border-box}.tna-container--no-padding,.tna-container--no-padding-all{max-width:1280px-64px}.tna-container--max{max-width:none}.tna-container--centred{justify-content:center}.tna-column{padding-right:16px;padding-left:16px;box-sizing:border-box}.tna-column--container{display:flex;flex-wrap:wrap;justify-content:stretch;align-items:stretch}.tna-column--align-top{align-self:flex-start}.tna-column--align-centre{align-self:center}.tna-column--align-bottom{align-self:flex-end}.tna-column--full{width:100%;flex:none}.tna-column--width-1-12{width:8.3333333333%;flex:none}.tna-column--margin-right-1-12{margin-right:8.3333333333%}.tna-column--margin-left-1-12{margin-left:8.3333333333%}.tna-column--width-1-6{width:16.6666666667%;flex:none}.tna-column--margin-right-1-6{margin-right:16.6666666667%}.tna-column--margin-left-1-6{margin-left:16.6666666667%}.tna-column--width-1-4{width:25%;flex:none}.tna-column--margin-right-1-4{margin-right:25%}.tna-column--margin-left-1-4{margin-left:25%}.tna-column--width-1-3{width:33.3333333333%;flex:none}.tna-column--margin-right-1-3{margin-right:33.3333333333%}.tna-column--margin-left-1-3{margin-left:33.3333333333%}.tna-column--width-5-12{width:41.6666666667%;flex:none}.tna-column--margin-right-5-12{margin-right:41.6666666667%}.tna-column--margin-left-5-12{margin-left:41.6666666667%}.tna-column--width-1-2{width:50%;flex:none}.tna-column--margin-right-1-2{margin-right:50%}.tna-column--margin-left-1-2{margin-left:50%}.tna-column--width-7-12{width:58.3333333333%;flex:none}.tna-column--margin-right-7-12{margin-right:58.3333333333%}.tna-column--margin-left-7-12{margin-left:58.3333333333%}.tna-column--width-2-3{width:66.6666666667%;flex:none}.tna-column--margin-right-2-3{margin-right:66.6666666667%}.tna-column--margin-left-2-3{margin-left:66.6666666667%}.tna-column--width-3-4{width:75%;flex:none}.tna-column--margin-right-3-4{margin-right:75%}.tna-column--margin-left-3-4{margin-left:75%}.tna-column--width-5-6{width:83.3333333333%;flex:none}.tna-column--margin-right-5-6{margin-right:83.3333333333%}.tna-column--margin-left-5-6{margin-left:83.3333333333%}.tna-column--width-11-12{width:91.6666666667%;flex:none}.tna-column--margin-right-11-12{margin-right:91.6666666667%}.tna-column--margin-left-11-12{margin-left:91.6666666667%}.tna-column--flex-1{width:auto;flex:1 0}.tna-column--flex-2{width:auto;flex:2 0}.tna-column--flex-3{width:auto;flex:3 0}.tna-column--order-1{order:1}.tna-column--order-2{order:2}.tna-column--order-3{order:3}.tna-column--order-4{order:4}@media(min-width: 48.0625em)and (max-width: 64em){.tna-column--full-medium{width:100%;flex:none}.tna-column--width-1-6-medium{width:16.6666666667%;flex:none}.tna-column--margin-right-1-6-medium{margin-right:16.6666666667%}.tna-column--margin-left-1-6-medium{margin-left:16.6666666667%}.tna-column--width-1-3-medium{width:33.3333333333%;flex:none}.tna-column--margin-right-1-3-medium{margin-right:33.3333333333%}.tna-column--margin-left-1-3-medium{margin-left:33.3333333333%}.tna-column--width-1-2-medium{width:50%;flex:none}.tna-column--margin-right-1-2-medium{margin-right:50%}.tna-column--margin-left-1-2-medium{margin-left:50%}.tna-column--width-2-3-medium{width:66.6666666667%;flex:none}.tna-column--margin-right-2-3-medium{margin-right:66.6666666667%}.tna-column--margin-left-2-3-medium{margin-left:66.6666666667%}.tna-column--width-5-6-medium{width:83.3333333333%;flex:none}.tna-column--margin-right-5-6-medium{margin-right:83.3333333333%}.tna-column--margin-left-5-6-medium{margin-left:83.3333333333%}.tna-column--no-margin-right-medium{margin-right:0}.tna-column--no-margin-left-medium{margin-left:0}.tna-column--flex-1-medium{width:auto;flex:1 0}.tna-column--flex-2-medium{width:auto;flex:2 0}.tna-column--flex-3-medium{width:auto;flex:3 0}.tna-column--order-1-medium{order:1}.tna-column--order-2-medium{order:2}.tna-column--order-3-medium{order:3}.tna-column--order-4-medium{order:4}}@media(max-width: 30em){.tna-container{padding-right:8px;padding-left:8px}.tna-column{padding-right:8px;padding-left:8px}}@media(min-width: 30.0625em)and (max-width: 48em){.tna-column--full-small{width:100%;flex:none}.tna-column--width-1-4-small{width:25%;flex:none}.tna-column--margin-right-1-4-small{margin-right:25%}.tna-column--margin-left-1-4-small{margin-left:25%}.tna-column--width-1-2-small{width:50%;flex:none}.tna-column--margin-right-1-2-small{margin-right:50%}.tna-column--margin-left-1-2-small{margin-left:50%}.tna-column--width-3-4-small{width:75%;flex:none}.tna-column--margin-right-3-4-small{margin-right:75%}.tna-column--margin-left-3-4-small{margin-left:75%}.tna-column--no-margin-right-small{margin-right:0}.tna-column--no-margin-left-small{margin-left:0}.tna-column--flex-1-small{width:auto;flex:1 0}.tna-column--flex-2-small{width:auto;flex:2 0}.tna-column--flex-3-small{width:auto;flex:3 0}.tna-column--order-1-small{order:1}.tna-column--order-2-small{order:2}.tna-column--order-3-small{order:3}.tna-column--order-4-small{order:4}}@media(max-width: 30em){.tna-column--full-tiny{width:100%;flex:none}.tna-column--width-1-2-tiny{width:50%;flex:none}.tna-column--margin-right-1-2-tiny{margin-right:50%}.tna-column--margin-left-1-2-tiny{margin-left:50%}.tna-column--no-margin-right-tiny{margin-right:0}.tna-column--no-margin-left-tiny{margin-left:0}.tna-column--flex-1-tiny{width:auto;flex:1 0}.tna-column--flex-2-tiny{width:auto;flex:2 0}.tna-column--flex-3-tiny{width:auto;flex:3 0}.tna-column--order-1-tiny{order:1}.tna-column--order-2-tiny{order:2}.tna-column--order-3-tiny{order:3}.tna-column--order-4-tiny{order:4}}.tna-container--no-padding,.tna-container--no-padding-all,.tna-container--no-padding-all>.tna-column,.tna-column--no-padding,.tna-column--container--no-padding-all,.tna-column--container--no-padding-all>.tna-column{padding-right:0;padding-left:0}/*# sourceMappingURL=grid.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/components/grid/grid.scss","../../../../src/nationalarchives/variables/_grid.scss","../../../../src/nationalarchives/tools/_grid.scss","../../../../src/nationalarchives/tools/_media.scss"],"names":[],"mappings":"AAKA,eACE,WACA,UCPwB,ODQxB,kBACA,iBACA,mBACA,kBAEA,aACA,eACA,2BACA,oBAEA,sBAEA,0DAEE,sBAGF,oBACE,eAGF,wBACE,uBAIJ,YACE,mBACA,kBAEA,sBAEA,uBACE,aACA,eACA,wBACA,oBAGF,uBACE,sBAGF,0BACE,kBAGF,0BACE,oBEtBA,kBACE,WACA,UAUI,wBACE,oBACA,UAGF,+BACE,2BAGF,8BACE,0BAVF,uBACE,qBACA,UAGF,8BACE,4BAGF,6BACE,2BAVF,uBACE,UACA,UAGF,8BACE,iBAGF,6BACE,gBAVF,uBACE,qBACA,UAGF,8BACE,4BAGF,6BACE,2BAVF,wBACE,qBACA,UAGF,+BACE,4BAGF,8BACE,2BAVF,uBACE,UACA,UAGF,8BACE,iBAGF,6BACE,gBAVF,wBACE,qBACA,UAGF,+BACE,4BAGF,8BACE,2BAVF,uBACE,qBACA,UAGF,8BACE,4BAGF,6BACE,2BAVF,uBACE,UACA,UAGF,8BACE,iBAGF,6BACE,gBAVF,uBACE,qBACA,UAGF,8BACE,4BAGF,6BACE,2BAVF,yBACE,qBACA,UAGF,gCACE,4BAGF,+BACE,2BAkCN,oBACE,WAEA,SAHF,oBACE,WAEA,SAHF,oBACE,WAEA,SAKF,qBACE,MAFS,EACX,qBACE,MAFS,EACX,qBACE,MAFS,EACX,qBACE,MAFS,ECnDf,kDDZE,yBACE,WACA,UAUI,8BACE,qBACA,UAGF,qCACE,4BAGF,oCACE,2BAVF,8BACE,qBACA,UAGF,qCACE,4BAGF,oCACE,2BAVF,8BACE,UACA,UAGF,qCACE,iBAGF,oCACE,gBAVF,8BACE,qBACA,UAGF,qCACE,4BAGF,oCACE,2BAVF,8BACE,qBACA,UAGF,qCACE,4BAGF,oCACE,2BAwBN,oCACE,eAGF,mCACE,cAKF,2BACE,WAEA,SAHF,2BACE,WAEA,SAHF,2BACE,WAEA,SAKF,4BACE,MAFS,EACX,4BACE,MAFS,EACX,4BACE,MAFS,EACX,4BACE,MAFS,GCvCf,wBHSA,eACE,kBACA,iBAGF,YACE,kBACA,kBGtBF,kDDlBE,wBACE,WACA,UAUI,6BACE,UACA,UAGF,oCACE,iBAGF,mCACE,gBAVF,6BACE,UACA,UAGF,oCACE,iBAGF,mCACE,gBAVF,6BACE,UACA,UAGF,oCACE,iBAGF,mCACE,gBAwBN,mCACE,eAGF,kCACE,cAKF,0BACE,WAEA,SAHF,0BACE,WAEA,SAHF,0BACE,WAEA,SAKF,2BACE,MAFS,EACX,2BACE,MAFS,EACX,2BACE,MAFS,EACX,2BACE,MAFS,GCvCf,wBDxBE,uBACE,WACA,UAUI,4BACE,UACA,UAGF,mCACE,iBAGF,kCACE,gBAwBN,kCACE,eAGF,iCACE,cAKF,yBACE,WAEA,SAHF,yBACE,WAEA,SAHF,yBACE,WAEA,SAKF,0BACE,MAFS,EACX,0BACE,MAFS,EACX,0BACE,MAFS,EACX,0BACE,MAFS,GFXjB,uNAME,gBACA","file":"grid.css","sourcesContent":["@use \"sass:math\";\n@use \"../../variables/grid\" as gridVars;\n@use \"../../tools/media\";\n@use \"../../tools/grid\";\n\n.tna-container {\n width: 100%;\n max-width: gridVars.$largest-container-width;\n margin-right: auto;\n margin-left: auto;\n padding-right: grid.gutter-width-half();\n padding-left: grid.gutter-width-half();\n\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: stretch;\n\n box-sizing: border-box;\n\n &--no-padding,\n &--no-padding-all {\n max-width: gridVars.$largest-container-width - grid.gutter-width-double();\n }\n\n &--max {\n max-width: none;\n }\n\n &--centred {\n justify-content: center;\n }\n}\n\n.tna-column {\n padding-right: grid.gutter-width-half();\n padding-left: grid.gutter-width-half();\n\n box-sizing: border-box;\n\n &--container {\n display: flex;\n flex-wrap: wrap;\n justify-content: stretch;\n align-items: stretch;\n }\n\n &--align-top {\n align-self: flex-start;\n }\n\n &--align-centre {\n align-self: center;\n }\n\n &--align-bottom {\n align-self: flex-end;\n }\n}\n\n@include grid.columns-generator(gridVars.$column-count);\n\n@include media.on-medium {\n @include grid.columns-generator(gridVars.$column-count-medium, \"medium\");\n}\n\n@include media.on-tiny {\n .tna-container {\n padding-right: grid.gutter-width-tiny-half();\n padding-left: grid.gutter-width-tiny-half();\n }\n\n .tna-column {\n padding-right: grid.gutter-width-tiny-half();\n padding-left: grid.gutter-width-tiny-half();\n }\n}\n\n@include media.on-small {\n @include grid.columns-generator(gridVars.$column-count-small, \"small\");\n}\n\n@include media.on-tiny {\n @include grid.columns-generator(gridVars.$column-count-tiny, \"tiny\");\n}\n\n.tna-container--no-padding,\n.tna-container--no-padding-all,\n.tna-container--no-padding-all > .tna-column,\n.tna-column--no-padding,\n.tna-column--container--no-padding-all,\n.tna-column--container--no-padding-all > .tna-column {\n padding-right: 0;\n padding-left: 0;\n}\n","$largest-container-width: 1280px !default;\n\n$gutter-width: 2 !default;\n$gutter-width-tiny: 1 !default;\n\n$column-count: 12;\n$column-count-medium: 6;\n$column-count-small: 4;\n$column-count-tiny: 2;\n","@use \"sass:math\";\n@use \"../variables/grid\";\n@use \"spacing\";\n\n@function gutter-width() {\n @return spacing.space(grid.$gutter-width);\n}\n\n@function gutter-width-half() {\n @return spacing.space(math.div(grid.$gutter-width, 2));\n}\n\n@function gutter-width-double() {\n @return spacing.space(grid.$gutter-width * 2);\n}\n\n@function gutter-width-tiny() {\n @return spacing.space(grid.$gutter-width-tiny);\n}\n\n@function gutter-width-tiny-half() {\n @return spacing.space(math.div(grid.$gutter-width-tiny, 2));\n}\n\n@function gutter-width-tiny-double() {\n @return spacing.space(grid.$gutter-width-tiny * 2);\n}\n\n@mixin columns-generator($count, $suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n\n .tna-column {\n &--full#{$suffix} {\n width: 100%;\n flex: none;\n }\n\n @for $i from 1 through $count - 1 {\n $simplest-fraction-found: false;\n\n @for $j from math.div($count, 2) through 1 {\n @if (\n $count % $j == 0 and $i % $j == 0 and $simplest-fraction-found != true\n ) {\n &--width-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {\n width: math.div(100%, $count) * $i;\n flex: none;\n }\n\n &--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {\n margin-right: math.div(100%, $count) * $i;\n }\n\n &--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {\n margin-left: math.div(100%, $count) * $i;\n }\n\n $simplest-fraction-found: true;\n }\n }\n\n @if $simplest-fraction-found != true {\n &--width-#{$i}-#{$count}#{$suffix} {\n width: math.div(100%, $count) * $i;\n flex: none;\n }\n\n &--margin-right-#{$i}-#{$count}#{$suffix} {\n margin-right: math.div(100%, $count) * $i;\n }\n\n &--margin-left-#{$i}-#{$count}#{$suffix} {\n margin-left: math.div(100%, $count) * $i;\n }\n }\n }\n\n @if $suffix != \"\" {\n &--no-margin-right#{$suffix} {\n margin-right: 0;\n }\n\n &--no-margin-left#{$suffix} {\n margin-left: 0;\n }\n }\n\n @for $i from 1 through 3 {\n &--flex-#{$i}#{$suffix} {\n width: auto;\n\n flex: $i 0;\n }\n }\n\n @for $i from 1 through 4 {\n &--order-#{$i}#{$suffix} {\n order: $i;\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n\n%hide-on-print {\n @media print {\n display: none;\n }\n}\n\n@mixin hide-on-print() {\n @extend %hide-on-print;\n}\n"]}