@nationalarchives/frontend 0.1.6-prerelease → 0.1.7-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.
- package/govuk-prototype-kit.config.json +12 -5
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/components/_all.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +68 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +57 -0
- package/nationalarchives/components/breadcrumbs/fixtures.json +26 -0
- package/nationalarchives/components/breadcrumbs/macro-options.json +40 -0
- package/nationalarchives/components/breadcrumbs/macro.njk +3 -0
- package/nationalarchives/components/breadcrumbs/template.njk +13 -0
- package/nationalarchives/components/button/_index.scss +6 -6
- package/nationalarchives/components/button/button.stories.js +1 -1
- package/nationalarchives/components/card/_index.scss +52 -61
- package/nationalarchives/components/card/card.stories.js +3 -3
- package/nationalarchives/components/card/template.njk +1 -1
- package/nationalarchives/components/footer/_index.scss +54 -54
- package/nationalarchives/components/footer/footer.stories.js +1 -1
- package/nationalarchives/components/grid/_index.scss +79 -82
- package/nationalarchives/components/grid/grid.stories.js +4 -1
- package/nationalarchives/components/grid/macro-options.json +7 -1
- package/nationalarchives/components/grid/template.njk +3 -0
- package/nationalarchives/components/hero/_index.scss +132 -0
- package/nationalarchives/components/hero/fixtures.json +4 -0
- package/nationalarchives/components/hero/hero.stories.js +74 -0
- package/nationalarchives/components/hero/macro-options.json +58 -0
- package/nationalarchives/components/hero/macro.njk +3 -0
- package/nationalarchives/components/hero/template.njk +30 -0
- package/nationalarchives/components/sensitive-image/_index.scss +49 -53
- package/nationalarchives/components/sensitive-image/sensitive-image.js +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.mjs +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +37 -1
- package/nationalarchives/stories/development/about.mdx +1 -1
- package/nationalarchives/stories/development/publishing.mdx +1 -0
- package/nationalarchives/templates/homepage.njk +2 -2
- package/nationalarchives/templates/search-results.njk +38 -0
- package/nationalarchives/templates/topics.njk +42 -0
- package/nationalarchives/tools/_all.scss +1 -0
- package/nationalarchives/tools/_grid.scss +4 -4
- package/nationalarchives/tools/_media.scss +62 -0
- package/nationalarchives/tools/_typography.scss +2 -2
- package/nationalarchives/utilities/_global.scss +1 -1
- package/nationalarchives/utilities/_typography.scss +104 -141
- package/nationalarchives/variables/_all.scss +1 -0
- package/nationalarchives/variables/_colour.scss +1 -0
- package/nationalarchives/variables/_typography.scss +7 -7
- package/package.json +13 -5
@@ -2,27 +2,19 @@
|
|
2
2
|
@use "../tools/typography" as tools;
|
3
3
|
|
4
4
|
// Temporary - will eventually bundle font files into package
|
5
|
-
@import
|
6
|
-
@import
|
5
|
+
@import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";
|
6
|
+
@import "https://use.typekit.net/hkj3kuz.css";
|
7
7
|
|
8
8
|
.tna-template {
|
9
|
-
font-family: typography.$
|
10
|
-
font-weight: typography.$
|
9
|
+
font-family: typography.$font-family-main;
|
10
|
+
font-weight: typography.$font-weight-main;
|
11
11
|
-moz-osx-font-smoothing: grayscale;
|
12
12
|
-webkit-font-smoothing: antialiased;
|
13
13
|
text-rendering: optimizeLegibility;
|
14
14
|
-webkit-text-size-adjust: none;
|
15
15
|
direction: ltr;
|
16
16
|
|
17
|
-
|
18
|
-
h2,
|
19
|
-
h3,
|
20
|
-
h4,
|
21
|
-
h5,
|
22
|
-
h6,
|
23
|
-
p,
|
24
|
-
ul,
|
25
|
-
ol {
|
17
|
+
p {
|
26
18
|
margin: 0 0 2rem;
|
27
19
|
|
28
20
|
&:last-child {
|
@@ -31,160 +23,131 @@
|
|
31
23
|
}
|
32
24
|
|
33
25
|
a {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
text-decoration-thickness: 3px;
|
38
|
-
}
|
26
|
+
&:active {
|
27
|
+
text-decoration-thickness: 4px;
|
28
|
+
}
|
39
29
|
|
40
|
-
|
41
|
-
|
42
|
-
}
|
30
|
+
&:hover {
|
31
|
+
text-decoration-thickness: 3px;
|
43
32
|
}
|
44
33
|
}
|
45
|
-
}
|
46
34
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
// .tna-#{$element} {
|
52
|
-
// margin: 0 0 2rem;
|
53
|
-
|
54
|
-
// outline: 1px #f90 solid;
|
55
|
-
|
56
|
-
// &:first-child {
|
57
|
-
// margin-top: 0;
|
58
|
-
// }
|
59
|
-
// }
|
60
|
-
// }
|
61
|
-
.tna-template p,
|
62
|
-
.tna-p,
|
63
|
-
.tna-template ul,
|
64
|
-
.tna-ul,
|
65
|
-
.tna-template ol,
|
66
|
-
.tna-ol {
|
67
|
-
// margin: 0 0 2rem;
|
68
|
-
|
69
|
-
// outline: 1px #f90 solid;
|
70
|
-
|
71
|
-
// &:first-child {
|
72
|
-
// margin-top: 0;
|
73
|
-
// }
|
74
|
-
}
|
35
|
+
.tna-template__body {
|
36
|
+
@include tools.relative-font-size(16);
|
37
|
+
line-height: 1.6;
|
38
|
+
}
|
75
39
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
// list-style: none;
|
86
|
-
// }
|
87
|
-
// }
|
88
|
-
// }
|
89
|
-
.tna-template ul,
|
90
|
-
.tna-ul,
|
91
|
-
.tna-template ol,
|
92
|
-
.tna-ol {
|
93
|
-
padding-left: 2rem;
|
94
|
-
|
95
|
-
li::marker {
|
96
|
-
color: #f0a;
|
97
|
-
font-weight: 700;
|
40
|
+
.tna-ul,
|
41
|
+
.tna-ol {
|
42
|
+
padding-left: 2rem;
|
43
|
+
|
44
|
+
li::marker {
|
45
|
+
color: #f0a;
|
46
|
+
font-weight: 700;
|
47
|
+
}
|
98
48
|
}
|
99
|
-
}
|
100
49
|
|
101
|
-
.tna-
|
102
|
-
.tna-
|
103
|
-
|
50
|
+
.tna-ul--plain,
|
51
|
+
.tna-ol--plain {
|
52
|
+
padding-left: 0;
|
104
53
|
|
105
|
-
|
106
|
-
}
|
54
|
+
list-style: none;
|
55
|
+
}
|
107
56
|
|
108
|
-
.tna-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
57
|
+
.tna-heading {
|
58
|
+
margin-top: 0;
|
59
|
+
margin-bottom: 1.5rem;
|
112
60
|
|
113
|
-
|
114
|
-
|
61
|
+
font-family: typography.$font-family-heading;
|
62
|
+
font-weight: typography.$font-weight-heading;
|
115
63
|
|
116
|
-
|
117
|
-
|
118
|
-
}
|
64
|
+
&:last-child {
|
65
|
+
margin-bottom: 0;
|
66
|
+
}
|
119
67
|
|
120
|
-
|
121
|
-
|
122
|
-
|
68
|
+
&--xl {
|
69
|
+
@include tools.relative-font-size(64);
|
70
|
+
line-height: 1;
|
71
|
+
}
|
123
72
|
|
124
|
-
|
125
|
-
|
126
|
-
|
73
|
+
&--l {
|
74
|
+
@include tools.relative-font-size(32);
|
75
|
+
line-height: 1.2;
|
76
|
+
}
|
127
77
|
|
128
|
-
|
129
|
-
|
130
|
-
|
78
|
+
&--m {
|
79
|
+
@include tools.relative-font-size(20);
|
80
|
+
line-height: 1.4;
|
81
|
+
}
|
131
82
|
|
132
|
-
|
133
|
-
|
134
|
-
|
83
|
+
&--s {
|
84
|
+
@include tools.relative-font-size(18);
|
85
|
+
line-height: 1.6;
|
86
|
+
}
|
87
|
+
}
|
135
88
|
|
136
|
-
.tna-hgroup {
|
137
|
-
|
89
|
+
.tna-hgroup {
|
90
|
+
margin-bottom: 2rem;
|
138
91
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
font-weight: typography.$fontWeightDetail;
|
143
|
-
text-transform: uppercase;
|
92
|
+
&:last-child {
|
93
|
+
margin-bottom: 0;
|
94
|
+
}
|
144
95
|
|
145
|
-
|
146
|
-
|
147
|
-
}
|
148
|
-
}
|
96
|
+
&__supertitle {
|
97
|
+
margin: 0;
|
149
98
|
|
150
|
-
.
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
}
|
99
|
+
@include tools.relative-font-size(14);
|
100
|
+
font-family: typography.$font-family-detail;
|
101
|
+
font-weight: typography.$font-weight-detail;
|
102
|
+
text-transform: uppercase;
|
155
103
|
|
156
|
-
.tna-hgroup
|
157
|
-
|
158
|
-
|
104
|
+
// .tna-hgroup & {
|
105
|
+
// margin: 0;
|
106
|
+
// }
|
107
|
+
}
|
159
108
|
|
160
|
-
|
161
|
-
|
162
|
-
}
|
163
|
-
}
|
109
|
+
&__title {
|
110
|
+
margin: 0;
|
164
111
|
|
165
|
-
.tna-
|
166
|
-
|
167
|
-
|
112
|
+
.tna-hgroup__supertitle {
|
113
|
+
display: block;
|
114
|
+
}
|
115
|
+
}
|
168
116
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
}
|
117
|
+
&--xl {
|
118
|
+
.tna-hgroup__supertitle {
|
119
|
+
}
|
173
120
|
|
174
|
-
.tna-
|
175
|
-
|
176
|
-
|
121
|
+
.tna-hgroup__title {
|
122
|
+
@include tools.relative-font-size(64);
|
123
|
+
}
|
124
|
+
}
|
177
125
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
}
|
126
|
+
&--l {
|
127
|
+
.tna-hgroup__supertitle {
|
128
|
+
}
|
182
129
|
|
183
|
-
.tna-
|
184
|
-
|
185
|
-
|
130
|
+
.tna-hgroup__title {
|
131
|
+
@include tools.relative-font-size(32);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
&--m {
|
136
|
+
.tna-hgroup__supertitle {
|
137
|
+
}
|
186
138
|
|
187
|
-
|
188
|
-
|
139
|
+
.tna-hgroup__title {
|
140
|
+
@include tools.relative-font-size(20);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
&--s {
|
145
|
+
.tna-hgroup__supertitle {
|
146
|
+
}
|
147
|
+
|
148
|
+
.tna-hgroup__title {
|
149
|
+
@include tools.relative-font-size(18);
|
150
|
+
}
|
151
|
+
}
|
189
152
|
}
|
190
153
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
$base-font-colour: #111 !default;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
$
|
1
|
+
$base-font-size-px: 16;
|
2
2
|
|
3
|
-
$
|
4
|
-
$
|
3
|
+
$font-family-main: "Open Sans", sans-serif;
|
4
|
+
$font-weight-main: 400;
|
5
5
|
|
6
|
-
$
|
7
|
-
$
|
6
|
+
$font-family-heading: supria-sans-condensed, monospace;
|
7
|
+
$font-weight-heading: 600;
|
8
8
|
|
9
|
-
$
|
10
|
-
$
|
9
|
+
$font-family-detail: "Roboto Mono", monospace;
|
10
|
+
$font-weight-detail: 500;
|
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nationalarchives/frontend",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.7-prerelease",
|
4
4
|
"description": "The National Archives frontend styles",
|
5
5
|
"scripts": {
|
6
6
|
"start": "storybook dev -p 6006",
|
7
7
|
"build": "storybook build -o storybook",
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
8
|
+
"test": "test-storybook --stories-json && node tasks/test-fixtures.js",
|
9
|
+
"lint": "prettier --check '{src,.storybook,tasks}/**/*.{js,mjs,scss,json}' && stylelint 'src/**/*.scss' && eslint 'src/**/*.mjs'",
|
10
|
+
"lint:fix": "prettier --write '{src,.storybook,tasks}/**/*.{js,mjs,scss,json}' && stylelint --fix 'src/**/*.scss' && eslint --fix 'src/**/*.mjs'",
|
11
11
|
"package:sass": "sass --style=compressed --quiet-deps src/nationalarchives/all.scss package/nationalarchives/all.css",
|
12
12
|
"package:scripts": "webpack"
|
13
13
|
},
|
@@ -34,7 +34,7 @@
|
|
34
34
|
},
|
35
35
|
"sass": "nationalarchives/all.scss",
|
36
36
|
"engines": {
|
37
|
-
"npm": "
|
37
|
+
"npm": "9.x",
|
38
38
|
"node": "18.x"
|
39
39
|
},
|
40
40
|
"homepage": "https://github.com/nationalarchives/tna-frontend#readme",
|
@@ -45,16 +45,21 @@
|
|
45
45
|
"@storybook/addon-a11y": "^7.0.22",
|
46
46
|
"@storybook/addon-docs": "^7.0.22",
|
47
47
|
"@storybook/addon-essentials": "^7.0.22",
|
48
|
+
"@storybook/addon-interactions": "^7.0.23",
|
48
49
|
"@storybook/addon-links": "^7.0.22",
|
49
50
|
"@storybook/addon-mdx-gfm": "^7.0.22",
|
50
51
|
"@storybook/html": "^7.0.22",
|
51
52
|
"@storybook/html-webpack5": "^7.0.22",
|
53
|
+
"@storybook/jest": "^0.1.0",
|
54
|
+
"@storybook/test-runner": "^0.11.0",
|
52
55
|
"@storybook/testing-library": "^0.2.0",
|
53
56
|
"babel-loader": "^9.0.1",
|
54
57
|
"copy-webpack-plugin": "^11.0.0",
|
55
58
|
"css-loader": "^6.7.1",
|
56
59
|
"diff": "^5.1.0",
|
60
|
+
"eslint": "^8.43.0",
|
57
61
|
"glob": "^10.2.7",
|
62
|
+
"jest-image-snapshot": "^6.1.0",
|
58
63
|
"nunjucks": "^3.2.3",
|
59
64
|
"prettier": "^2.7.1",
|
60
65
|
"react": "^18.2.0",
|
@@ -64,6 +69,9 @@
|
|
64
69
|
"simple-nunjucks-loader": "^3.2.0",
|
65
70
|
"storybook": "^7.0.22",
|
66
71
|
"style-loader": "^3.3.1",
|
72
|
+
"stylelint": "^15.9.0",
|
73
|
+
"stylelint-config-standard-scss": "^9.0.0",
|
74
|
+
"stylelint-selector-bem-pattern": "^2.1.1",
|
67
75
|
"webpack": "^5.74.0",
|
68
76
|
"webpack-cli": "^5.1.4"
|
69
77
|
}
|