@nationalarchives/frontend 0.1.9-prerelease → 0.1.10-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 (57) hide show
  1. package/README.md +2 -2
  2. package/nationalarchives/_features.scss +1 -0
  3. package/nationalarchives/all.css +1 -1
  4. package/nationalarchives/all.css.map +1 -1
  5. package/nationalarchives/all.js +1 -1
  6. package/nationalarchives/all.js.map +1 -1
  7. package/nationalarchives/all.mjs +37 -2
  8. package/nationalarchives/assets/images/footer/facebook.svg +11 -0
  9. package/nationalarchives/assets/images/footer/flickr.svg +11 -0
  10. package/nationalarchives/assets/images/footer/instagram.svg +17 -0
  11. package/nationalarchives/assets/images/footer/rss.svg +13 -0
  12. package/nationalarchives/assets/images/footer/twitter.svg +14 -0
  13. package/nationalarchives/assets/images/footer/youtube.svg +12 -0
  14. package/nationalarchives/components/_all.scss +3 -0
  15. package/nationalarchives/components/breadcrumbs/_index.scss +2 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -2
  17. package/nationalarchives/components/button/button.stories.js +1 -2
  18. package/nationalarchives/components/card/card.stories.js +1 -2
  19. package/nationalarchives/components/filters/filters.stories.js +1 -2
  20. package/nationalarchives/components/footer/_index.scss +46 -3
  21. package/nationalarchives/components/footer/fixtures.json +1 -1
  22. package/nationalarchives/components/footer/footer.stories.js +21 -24
  23. package/nationalarchives/components/footer/macro-options.json +12 -6
  24. package/nationalarchives/components/footer/template.njk +23 -13
  25. package/nationalarchives/components/grid/grid.stories.js +2 -3
  26. package/nationalarchives/components/header/_index.scss +180 -36
  27. package/nationalarchives/components/header/header.js +1 -1
  28. package/nationalarchives/components/header/header.js.map +1 -1
  29. package/nationalarchives/components/header/header.mjs +6 -0
  30. package/nationalarchives/components/header/header.stories.js +14 -5
  31. package/nationalarchives/components/header/macro-options.json +57 -5
  32. package/nationalarchives/components/header/template.njk +20 -8
  33. package/nationalarchives/components/hero/_index.scss +3 -0
  34. package/nationalarchives/components/hero/hero.stories.js +15 -13
  35. package/nationalarchives/components/hero/macro-options.json +1 -1
  36. package/nationalarchives/components/phase-banner/_index.scss +43 -0
  37. package/nationalarchives/components/phase-banner/fixtures.json +14 -0
  38. package/nationalarchives/components/phase-banner/macro-options.json +26 -0
  39. package/nationalarchives/components/phase-banner/macro.njk +3 -0
  40. package/nationalarchives/components/phase-banner/phase-banner.stories.js +38 -0
  41. package/nationalarchives/components/phase-banner/template.njk +16 -0
  42. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -2
  43. package/nationalarchives/stories/development/contributing.mdx +38 -0
  44. package/nationalarchives/stories/development/dependencies.mdx +2 -0
  45. package/nationalarchives/stories/development/technologies.mdx +65 -0
  46. package/nationalarchives/templates/layouts/_generic.njk +1 -1
  47. package/nationalarchives/tools/_all.scss +1 -0
  48. package/nationalarchives/tools/_assets.scss +5 -0
  49. package/nationalarchives/tools/_media.scss +12 -11
  50. package/nationalarchives/utilities/_global.scss +95 -2
  51. package/nationalarchives/utilities/_typography.scss +109 -97
  52. package/nationalarchives/variables/_all.scss +1 -0
  53. package/nationalarchives/variables/_assets.scss +1 -0
  54. package/nationalarchives/variables/_colour.scss +88 -4
  55. package/nationalarchives/variables/_media.scss +39 -11
  56. package/package.json +15 -13
  57. package/nationalarchives/stories/development/structure.mdx +0 -7
@@ -1,14 +1,14 @@
1
1
  import Header from "./template.njk";
2
- import "./_index.scss";
3
2
  import macroOptions from "./macro-options.json";
4
3
 
5
4
  const argTypes = {
6
- strapline: { control: "text" },
5
+ logo: { control: "object" },
7
6
  navigation: { control: "object" },
8
7
  colour: {
9
8
  control: "radio",
10
9
  options: ["black", "yellow", "pink", "orange", "green", "blue"],
11
10
  },
11
+ exit: { control: "object" },
12
12
  classes: { control: "text" },
13
13
  attributes: { control: "object" },
14
14
  };
@@ -24,12 +24,13 @@ export default {
24
24
  argTypes,
25
25
  };
26
26
 
27
- const Template = ({ strapline, navigation, colour, classes, attributes }) => {
27
+ const Template = ({ logo, navigation, colour, exit, classes, attributes }) => {
28
28
  return Header({
29
29
  params: {
30
- strapline,
30
+ logo,
31
31
  navigation,
32
32
  colour,
33
+ exit,
33
34
  classes,
34
35
  attributes,
35
36
  },
@@ -38,7 +39,10 @@ const Template = ({ strapline, navigation, colour, classes, attributes }) => {
38
39
 
39
40
  export const Standard = Template.bind({});
40
41
  Standard.args = {
41
- strapline: "Beta",
42
+ logo: {
43
+ strapline: "Beta",
44
+ href: "#/",
45
+ },
42
46
  navigation: [
43
47
  {
44
48
  text: "Alpha",
@@ -55,5 +59,10 @@ Standard.args = {
55
59
  },
56
60
  ],
57
61
  colour: "yellow",
62
+ exit: {
63
+ text: "Go to the current National Archives website",
64
+ href: "#",
65
+ target: "_blank",
66
+ },
58
67
  classes: "tna-header--demo",
59
68
  };
@@ -1,9 +1,29 @@
1
1
  [
2
2
  {
3
- "name": "strapline",
4
- "type": "string",
3
+ "name": "logo",
4
+ "type": "object",
5
5
  "required": false,
6
- "description": ""
6
+ "description": "",
7
+ "params": [
8
+ {
9
+ "name": "href",
10
+ "type": "string",
11
+ "required": false,
12
+ "description": ""
13
+ },
14
+ {
15
+ "name": "title",
16
+ "type": "string",
17
+ "required": false,
18
+ "description": ""
19
+ },
20
+ {
21
+ "name": "strapline",
22
+ "type": "string",
23
+ "required": false,
24
+ "description": ""
25
+ }
26
+ ]
7
27
  },
8
28
  {
9
29
  "name": "navigation",
@@ -37,16 +57,48 @@
37
57
  }
38
58
  ]
39
59
  },
60
+ {
61
+ "name": "colour",
62
+ "type": "string",
63
+ "required": false,
64
+ "description": ""
65
+ },
66
+ {
67
+ "name": "exit",
68
+ "type": "object",
69
+ "required": false,
70
+ "description": "",
71
+ "params": [
72
+ {
73
+ "name": "text",
74
+ "type": "string",
75
+ "required": true,
76
+ "description": ""
77
+ },
78
+ {
79
+ "name": "href",
80
+ "type": "string",
81
+ "required": true,
82
+ "description": ""
83
+ },
84
+ {
85
+ "name": "target",
86
+ "type": "string",
87
+ "required": false,
88
+ "description": ""
89
+ }
90
+ ]
91
+ },
40
92
  {
41
93
  "name": "classes",
42
94
  "type": "string",
43
95
  "required": false,
44
- "description": "Classes to add to the hero."
96
+ "description": "Classes to add to the header."
45
97
  },
46
98
  {
47
99
  "name": "attributes",
48
100
  "type": "object",
49
101
  "required": false,
50
- "description": "HTML attributes (for example data attributes) to add to the hero."
102
+ "description": "HTML attributes (for example data attributes) to add to the header."
51
103
  }
52
104
  ]
@@ -3,10 +3,24 @@
3
3
  {%- set classes = classes.concat('tna-header--' + params.colour) -%}
4
4
  {%- endif -%}
5
5
  <header class="tna-header {{ classes | join(' ') }}" data-module="tna-header" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
6
+ {%- if params.exit -%}
7
+ <div class="tna-header__exit">
8
+ <div class="tna-container">
9
+ <div class="tna-column tna-column--full">
10
+ <a href="{{ params.exit.href }}" class="tna-header__exit-link"{%- if params.exit.target -%} target="{{ params.exit.target }}"{%- endif -%}>
11
+ {{ params.exit.text }}
12
+ {%- if params.exit.target == "_blank" -%}
13
+ <span class="tna-header__exit-link-icon"></span>
14
+ {%- endif -%}
15
+ </a>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ {%- endif -%}
6
20
  <div class="tna-container tna-header__contents">
7
21
  <div class="tna-column tna-header__logo">
8
- <a href="#" class="tna-header__logo-link">
9
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" viewBox="0 0 160 160" style="enable-background:new 0 0 160 160;" xml:space="preserve" class="tna-logo">
22
+ <{%- if params.logo.href -%}a href="{{ params.logo.href }}" class="tna-header__logo-link tna-header__logo-link--href"{%- else -%}span class="tna-header__logo-link"{%- endif -%}>
23
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" viewBox="0 0 160 160" style="enable-background:new 0 0 160 160;" xml:space="preserve" class="tna-logo" width="100" height="100">
10
24
  <rect class="tna-logo__background" fill="none" width="160" height="160"/>
11
25
  <g class="tna-logo__foreground" fill="#000">
12
26
  <path d="M1.9,107.2h156.3V158H1.9V107.2z M1.9,54.5h79.1h77.2v50.8H1.9V54.5z M1.9,1.9h77.2v50.8H1.9V1.9z M80.9,1.9 h77.2v50.8H80.9C80.9,52.7,80.9,1.9,80.9,1.9z M80.9,0H0v52.7v1.9v50.8v1.9v52.7h160v-52.7v-1.9V52.7V0H80.9z"/>
@@ -31,15 +45,13 @@
31
45
  <path d="M130.4,136c0,0.2-0.1,0.5-0.1,0.8c0,1.9,0.8,3.7,3.4,3.7c2.1,0,3.3-1.2,3.3-2.9c0-1.6-0.7-2.4-2.2-3l-3.4-1.3c-2.4-0.9-4.2-2.4-4.2-5.7c0-3.5,2.3-6.1,6.6-6.1c5.5,0,6.4,3.6,6.4,5.9c0,0.3,0,0.7-0.1,1.1l-3.4,0.1c0-0.2,0.1-0.5,0.1-0.7c0-1.7-0.6-3.2-3-3.2c-2.1,0-3,1.2-3,2.8c0,1.7,0.9,2.5,2.2,2.9l3.5,1.3c2.6,1,4.3,2.6,4.3,5.8c0,3.6-2.4,6.1-7,6.1c-5.9,0-6.8-3.9-6.8-6.5c0-0.3,0-0.6,0.1-1L130.4,136z"/>
32
46
  </g>
33
47
  </svg>
34
- {%- if params.strapline -%}
35
- <span class="tna-header__logo-strapline">{{ params.strapline }}</span>
48
+ {%- if params.logo.strapline -%}
49
+ <span class="tna-header__logo-strapline">{{ params.logo.strapline }}</span>
36
50
  {%- endif -%}
37
- </a>
51
+ </{%- if params.logo.href -%}a{%- else -%}span{%- endif -%}>
38
52
  </div>
39
53
  {%- if params.navigation -%}
40
- <div class="tna-column tna-column--flex-1- tna-header__navigation-toggle">
41
- <!-- POPULATED BY JAVASCRIPT IF ENABLED -->
42
- </div>
54
+ <div class="tna-column tna-column--flex-1- tna-header__navigation-toggle"><!-- POPULATED BY JAVASCRIPT IF ENABLED --></div>
43
55
  <nav class="tna-column tna-column--flex-1 tna-column--full-small tna-column--full-tiny tna-header__navigation" aria-label="Main site navigation">
44
56
  <ul class="tna-header__navigation-items">
45
57
  {%- for item in params.navigation -%}
@@ -96,6 +96,7 @@
96
96
  }
97
97
 
98
98
  &__body {
99
+ margin-top: 1.5rem;
99
100
  }
100
101
 
101
102
  @include media.on-mobile {
@@ -138,9 +139,11 @@
138
139
  }
139
140
 
140
141
  &__heading {
142
+ color: inherit;
141
143
  }
142
144
 
143
145
  &__body {
146
+ color: inherit;
144
147
  }
145
148
  }
146
149
 
@@ -1,5 +1,4 @@
1
1
  import Hero from "./template.njk";
2
- import "./_index.scss";
3
2
  import macroOptions from "./macro-options.json";
4
3
  import { expect } from "@storybook/jest";
5
4
  import { within, userEvent } from "@storybook/testing-library";
@@ -49,7 +48,7 @@ Standard.args = {
49
48
  classes: "tna-hero--demo",
50
49
  };
51
50
 
52
- Standard.play = async ({ args, canvasElement }) => {
51
+ Standard.play = async ({ args, canvasElement, step }) => {
53
52
  const canvas = within(canvasElement);
54
53
  const image = canvas.getByAltText(args.image.alt);
55
54
  const title = canvas.getByText(args.heading);
@@ -58,17 +57,20 @@ Standard.play = async ({ args, canvasElement }) => {
58
57
  );
59
58
  const information = canvas.getByText(args.image.information);
60
59
 
61
- await expect(image).toBeVisible();
62
- await expect(title).toBeVisible();
63
- await expect(summary).toBeVisible();
64
- await expect(information).not.toBeVisible();
60
+ await step("Initial load", async () => {
61
+ await expect(image).toBeVisible();
62
+ await expect(title).toBeVisible();
63
+ await expect(summary).toBeVisible();
64
+ await expect(information).not.toBeVisible();
65
+ });
65
66
 
66
- await userEvent.click(summary);
67
- await expect(image).toBeVisible();
68
- await expect(title).toBeVisible();
69
- await expect(summary).toBeVisible();
70
- await expect(information).toBeVisible();
67
+ await step("Open information", async () => {
68
+ await userEvent.click(summary);
69
+ await expect(information).toBeVisible();
70
+ });
71
71
 
72
- await userEvent.click(summary);
73
- await expect(information).not.toBeVisible();
72
+ await step("Close information", async () => {
73
+ await userEvent.click(summary);
74
+ await expect(information).not.toBeVisible();
75
+ });
74
76
  };
@@ -2,7 +2,7 @@
2
2
  {
3
3
  "name": "heading",
4
4
  "type": "string",
5
- "required": false,
5
+ "required": true,
6
6
  "description": ""
7
7
  },
8
8
  {
@@ -0,0 +1,43 @@
1
+ @use "../../tools/media";
2
+ @use "../../tools/typography";
3
+
4
+ .tna-phase-banner {
5
+ padding-top: 0.375rem;
6
+ padding-bottom: 0.375rem;
7
+
8
+ .tna-container {
9
+ align-items: center;
10
+ flex-wrap: nowrap;
11
+
12
+ // @include media.on-tiny {
13
+ // flex-wrap: wrap;
14
+ // }
15
+ }
16
+
17
+ &__phase {
18
+ margin: 0.25rem 0;
19
+ padding: 0 0.5rem;
20
+
21
+ display: block;
22
+
23
+ font-weight: 700;
24
+ text-transform: uppercase;
25
+ line-height: 1.5;
26
+
27
+ background-color: #fff;
28
+ }
29
+
30
+ &__message {
31
+ margin: 0.25rem 0;
32
+
33
+ // @include typography.relative-font-size(14);
34
+
35
+ a {
36
+ color: inherit;
37
+ }
38
+ }
39
+
40
+ &--beta {
41
+ background-color: #f9f7e2;
42
+ }
43
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "component": "phase-banner",
3
+ "fixtures": [
4
+ {
5
+ "name": "beta",
6
+ "options": {
7
+ "phase": "Beta",
8
+ "message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
9
+ },
10
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--beta\">\n <div class=\"tna-container\">\n <div class=\"tna-column\">\n <span class=\"tna-phase-banner__phase\">\n Beta\n </span>\n </div>\n <div class=\"tna-column\">\n <p class=\"tna-phase-banner__message\">\n This is a new service – <a href='#'>give us your feedback</a> to help improve it.\n </p>\n </div>\n </div>\n</div>",
11
+ "hidden": false
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,26 @@
1
+ [
2
+ {
3
+ "name": "phase",
4
+ "type": "string",
5
+ "required": true,
6
+ "description": ""
7
+ },
8
+ {
9
+ "name": "message",
10
+ "type": "string",
11
+ "required": true,
12
+ "description": ""
13
+ },
14
+ {
15
+ "name": "classes",
16
+ "type": "string",
17
+ "required": false,
18
+ "description": "Classes to add to the phase banner."
19
+ },
20
+ {
21
+ "name": "attributes",
22
+ "type": "object",
23
+ "required": false,
24
+ "description": "HTML attributes (for example data attributes) to add to the phase banner."
25
+ }
26
+ ]
@@ -0,0 +1,3 @@
1
+ {% macro tnaPhaseBanner(params) %}
2
+ {%- include "./template.njk" -%}
3
+ {% endmacro %}
@@ -0,0 +1,38 @@
1
+ import PhaseBanner from "./template.njk";
2
+ import macroOptions from "./macro-options.json";
3
+
4
+ const argTypes = {
5
+ phase: { control: "text" },
6
+ message: { control: "text" },
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/Phase banner",
19
+ argTypes,
20
+ };
21
+
22
+ const Template = ({ phase, message, classes, attributes }) => {
23
+ return PhaseBanner({
24
+ params: {
25
+ phase,
26
+ message,
27
+ classes,
28
+ attributes,
29
+ },
30
+ });
31
+ };
32
+
33
+ export const Standard = Template.bind({});
34
+ Standard.args = {
35
+ phase: "Beta",
36
+ message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
37
+ classes: "tna-phase-banner--demo",
38
+ };
@@ -0,0 +1,16 @@
1
+ {%- set classes = [params.classes] if params.classes else [] -%}
2
+ {%- set classes = classes.concat('tna-phase-banner--' + params.phase | lower) -%}
3
+ <div class="tna-phase-banner {{ classes | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
4
+ <div class="tna-container">
5
+ <div class="tna-column">
6
+ <span class="tna-phase-banner__phase">
7
+ {{ params.phase }}
8
+ </span>
9
+ </div>
10
+ <div class="tna-column">
11
+ <p class="tna-phase-banner__message">
12
+ {{ params.message | safe }}
13
+ </p>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -1,5 +1,4 @@
1
1
  import SensitiveImage from "./template.njk";
2
- import "./_index.scss";
3
2
  import macroOptions from "./macro-options.json";
4
3
  import { expect } from "@storybook/jest";
5
4
  import { within, userEvent } from "@storybook/testing-library";
@@ -20,7 +19,7 @@ Object.keys(argTypes).forEach((argType) => {
20
19
  });
21
20
 
22
21
  export default {
23
- title: "Experimental/Sensitive image",
22
+ title: "Components/Experimental/Sensitive image",
24
23
  argTypes,
25
24
  };
26
25
 
@@ -0,0 +1,38 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/Contributing" />
4
+
5
+ # Contributing to the frontend styles
6
+
7
+ ## Adding a new component
8
+
9
+ 1. Create a new directory in `src/nationalarchives/components`
10
+ 1. Create an `_index.scss`, `fixtures.json`, `macro-options.json`, `macro.njk`, `template.njk` and a `[myComponent].stories.js` in the directory using other components as a guide
11
+ 1. Add the component SCSS to src/nationalarchives/components/_all.scss
12
+ 1. Update `tasks/test-package.js` to check for the files as part of the CI (`...componentFiles("myComponent", true)` where `true` ignores the check for any JavaScript files)
13
+ 1. Set the macro in `macro.njk` to be `tnaMyComponent` where "MyComponent" is the name of your component
14
+
15
+ ### Files
16
+
17
+ - `_index.scss` - where you can add your [BEM](https://getbem.com/) SCSS styles for the component
18
+ - `fixtures.json` - these are snapshots of the rendered component's HTML in different scenarios which can be used by other implementations to test against
19
+ - `macro-options.json` - the options for the component which are rendered in the Design System as well as being copied in to the Storybook controls
20
+ - `macro.njk` - the Nunjucks macro easily allows us to include components in the prototype kit and other applications such as the Design System
21
+ - `template.njk` - this is the HTML for the component, written in [Nunjucks](https://mozilla.github.io/nunjucks/)
22
+ - `[myComponent].stories.js` - the stories that get rendered to Storybook
23
+
24
+ ### If you need JavaScript
25
+
26
+ 1. Create a `[myComponent].mjs` file in the component directory
27
+ 1. Ensure the top level element in your component has the attribute `data-module="tna-my-component"`
28
+ 1. Import and initialise your component as part of the `initAll` function in `src/nationalarchives/all.mjs`
29
+ 1. Update the check in `tasks/test-package.js` to remove the `true` and enable checking of the JavaScript file (`...componentFiles("myComponent")`)
30
+ 1. If your component uses JavaScript, ensure you add interaction tests using `@storybook/testing-library`
31
+
32
+ ### Best practices
33
+
34
+ [TODO]
35
+
36
+ ## Updating a component
37
+
38
+ [TODO]
@@ -6,4 +6,6 @@ import { Meta } from "@storybook/blocks";
6
6
 
7
7
  ```sh
8
8
  npx sb upgrade
9
+ # or
10
+ npx storybook@latest upgrade
9
11
  ```
@@ -0,0 +1,65 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/Technologies" />
4
+
5
+ # Technologies
6
+
7
+ ## Storybook
8
+
9
+ Most widely supported open source frontend workshop for building UI components, constantly updated, also used by TDR
10
+
11
+ ## ESNext JavaScript (not TypeScript)
12
+
13
+ JavaScript over TypeScript to allow in-project compilation and possible tree-shaking without extra libraries
14
+
15
+ ## Babel
16
+
17
+ De facto JavaScript compiler and transpiler, allows us to use most up-to-date JavaScript for increased efficiency and cleaner source code
18
+
19
+ ## SCSS
20
+
21
+ Most mature CSS preprocessor, used in other TNA projects, huge support
22
+
23
+ ## BEM
24
+
25
+ Agreed CSS methodology within TNA
26
+
27
+ ## Webpack
28
+
29
+ Already used in many TNA projects, most mature offering although arguably not the fastest - we could consider changing in the future
30
+
31
+ ## Nunjucks
32
+
33
+ Used by GDS and made by Mozilla, Nunjucks is simple and expandable and allows us to use components in the GOV.UK prototype kit
34
+
35
+ ## npm
36
+
37
+ Used by many TNA projects and provides highly available package repository, de facto standard for JavaScript packages
38
+
39
+ ## GitHub actions
40
+
41
+ Free actions not relying on external services, used on some TNA projects but will allow us to have more of a CI/CD methodology
42
+
43
+ ## Prettier
44
+
45
+ Opinionated code formatter for (S)CSS, JavaScript, JSON and other file types, intended to reduce bikeshedding
46
+
47
+ ## ESLint
48
+
49
+ De facto linter for JavaScript to catch potential issues
50
+
51
+ ## Stylelint
52
+
53
+ Most widely supported and mature (S)CSS linter
54
+
55
+ ## Jest
56
+
57
+ Lightweight and fast testing library, support for Storybook, easy learning curve
58
+
59
+ ## NVM
60
+
61
+ Ensures all developers can work on the same version of NodeJS, reduces differences between development environments
62
+
63
+ ## Chromatic.com
64
+
65
+ Suggested by Storybook for visual regression testing
@@ -1,7 +1,7 @@
1
1
  {# Based on https://github.com/alphagov/govuk-frontend/blob/8b6bf304b9fc891f64459c25a08f3d623f3fea72/packages/govuk-frontend/src/govuk/template.njk #}
2
2
  {#% from "./components/skip-link/macro.njk" import tnaSkipLink -%#}
3
3
  <!DOCTYPE html>
4
- <html lang="{{ htmlLang | default('en') }}" class="tna-template js-disabled {{ htmlClasses }}">
4
+ <html lang="{{ htmlLang | default('en') }}" class="tna-template tna-template--js-disabled {{ htmlClasses }}">
5
5
  <head>
6
6
  <meta charset="utf-8">
7
7
  <title{% if pageTitleLang %} lang="{{ pageTitleLang }}"{% endif %}>{% block pageTitle %}The National Archives{% endblock %}</title>
@@ -1,3 +1,4 @@
1
+ @use "assets";
1
2
  @use "grid";
2
3
  @use "media";
3
4
  @use "typography";
@@ -0,0 +1,5 @@
1
+ @use "../variables/assets";
2
+
3
+ @function tna-asset-url($asset) {
4
+ @return #{assets.$tna-assets-path}/#{$asset};
5
+ }
@@ -1,17 +1,18 @@
1
1
  @use "../variables/media";
2
2
 
3
- // 0 ============= 480 ===== 768 == 1024 ==========================
4
- // | | | |
5
- // | TINY | SMALL | MED | LARGE
6
- // | | | |
7
- // |<------------->| . . on-tiny
8
- // |<----------------------->| . on-mobile
3
+ // 0 ======= 320 = 480 ===== 768 == 1024 ========================== min-width/max-width (px)
4
+ // | . | | |
5
+ // |-TINY----------|-SMALL---|-MED--|-LARGE------------------------
6
+ // | . | | |
7
+ // |<------------->| | | on-tiny
8
+ // |<----------------------->| | on-mobile
9
9
  // |<------------------------------>| on-smaller-than-large
10
- // . |<------->| . on-small
11
- // . |<------------------------- on-larger-than-tiny
12
- // . . |<---->| on-medium
13
- // . . |<--------------- on-larger-than-mobile
14
- // . . . |<-------- on-large
10
+ // | . |<------->| | on-small
11
+ // | . |<------------------------- on-larger-than-tiny
12
+ // | . | |<---->| on-medium
13
+ // | . | |<--------------- on-larger-than-mobile
14
+ // | . | | |<-------- on-large
15
+ // |<------->. | | | Smallest device
15
16
 
16
17
  @mixin on-large() {
17
18
  @media #{media.$media-large} {