@nationalarchives/frontend 0.1.3-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/README.md +191 -0
- package/govuk-prototype-kit.config.json +14 -0
- package/nationalarchives/_base.scss +6 -0
- package/nationalarchives/_prototype-kit.scss +3 -0
- package/nationalarchives/all.css +1 -0
- package/nationalarchives/all.css.map +1 -0
- package/nationalarchives/all.js +2 -0
- package/nationalarchives/all.js.map +1 -0
- package/nationalarchives/all.mjs +13 -0
- package/nationalarchives/all.scss +9 -0
- package/nationalarchives/assets/images/apple-touch-icon-152x152.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon-167x167.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon-180x180.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon.png +0 -0
- package/nationalarchives/assets/images/favicon.ico +0 -0
- package/nationalarchives/assets/images/mask-icon.svg +6 -0
- package/nationalarchives/assets/images/nationalarchives-opengraph-image.png +0 -0
- package/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg +51 -0
- package/nationalarchives/assets/images/tna-horizontal-logo.svg +51 -0
- package/nationalarchives/assets/images/tna-square-logo-inverted.svg +47 -0
- package/nationalarchives/assets/images/tna-square-logo.svg +47 -0
- package/nationalarchives/components/_all.scss +7 -0
- package/nationalarchives/components/button/_button.scss +2 -0
- package/nationalarchives/components/button/_index.scss +26 -0
- package/nationalarchives/components/button/button.stories.js +52 -0
- package/nationalarchives/components/button/fixtures.json +56 -0
- package/nationalarchives/components/button/macro-options.json +38 -0
- package/nationalarchives/components/button/macro.njk +3 -0
- package/nationalarchives/components/button/template.njk +7 -0
- package/nationalarchives/components/card/_card.scss +2 -0
- package/nationalarchives/components/card/_index.scss +37 -0
- package/nationalarchives/components/card/card.stories.js +77 -0
- package/nationalarchives/components/card/fixtures.json +29 -0
- package/nationalarchives/components/card/macro-options.json +96 -0
- package/nationalarchives/components/card/macro.njk +3 -0
- package/nationalarchives/components/card/template.njk +33 -0
- package/nationalarchives/components/footer/_footer.scss +2 -0
- package/nationalarchives/components/footer/_index.scss +77 -0
- package/nationalarchives/components/footer/fixtures.json +11 -0
- package/nationalarchives/components/footer/footer.stories.js +170 -0
- package/nationalarchives/components/footer/macro-options.json +80 -0
- package/nationalarchives/components/footer/macro.njk +3 -0
- package/nationalarchives/components/footer/template.njk +46 -0
- package/nationalarchives/components/grid/_grid.scss +2 -0
- package/nationalarchives/components/grid/_index.scss +84 -0
- package/nationalarchives/components/grid/fixtures.json +273 -0
- package/nationalarchives/components/grid/grid.stories.js +192 -0
- package/nationalarchives/components/grid/macro-options.json +106 -0
- package/nationalarchives/components/grid/macro.njk +3 -0
- package/nationalarchives/components/grid/template.njk +44 -0
- package/nationalarchives/components/sensitive-image/_index.scss +84 -0
- package/nationalarchives/components/sensitive-image/_sensitive-image.scss +2 -0
- package/nationalarchives/components/sensitive-image/fixtures.json +54 -0
- package/nationalarchives/components/sensitive-image/macro-options.json +58 -0
- package/nationalarchives/components/sensitive-image/macro.njk +3 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.js +2 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.mjs +26 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +49 -0
- package/nationalarchives/components/sensitive-image/template.njk +10 -0
- package/nationalarchives/stories/development/structure.mdx +7 -0
- package/nationalarchives/stories/global/heading-groups.stories.js +23 -0
- package/nationalarchives/stories/global/headings.stories.js +40 -0
- package/nationalarchives/stories/global/typography.mdx +22 -0
- package/nationalarchives/stories/global/typography.stories.js +15 -0
- package/nationalarchives/tools/_all.scss +1 -0
- package/nationalarchives/tools/_exports.scss +36 -0
- package/nationalarchives/utilities/_all.scss +3 -0
- package/nationalarchives/utilities/_global.scss +39 -0
- package/nationalarchives/utilities/_grid.scss +131 -0
- package/nationalarchives/utilities/_typography.scss +82 -0
- package/nationalarchives/variables/_all.scss +2 -0
- package/nationalarchives/variables/_grid.scss +9 -0
- package/nationalarchives/variables/_media.scss +12 -0
- package/package.json +70 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
@import "../variables/all";
|
2
|
+
|
3
|
+
@mixin columns-generator($count, $suffix: "") {
|
4
|
+
@for $i from 1 through $count - 1 {
|
5
|
+
$simplestFractionFound: false;
|
6
|
+
|
7
|
+
@for $j from math.div($count, 2) through 1 {
|
8
|
+
@if (
|
9
|
+
$count % $j == 0 and $i % $j == 0 and $simplestFractionFound != true
|
10
|
+
) {
|
11
|
+
.tna-column--width-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
|
12
|
+
width: math.div(100%, $count) * $i;
|
13
|
+
}
|
14
|
+
|
15
|
+
// .column--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
|
16
|
+
// margin-right: math.div(100%, $count) * $i;
|
17
|
+
// }
|
18
|
+
|
19
|
+
// .column--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
|
20
|
+
// margin-left: math.div(100%, $count) * $i;
|
21
|
+
// }
|
22
|
+
|
23
|
+
$simplestFractionFound: true;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
@if ($simplestFractionFound != true) {
|
28
|
+
.tna-column--width-#{$i}-#{$count}#{$suffix} {
|
29
|
+
width: math.div(100%, $count) * $i;
|
30
|
+
}
|
31
|
+
|
32
|
+
// .column--margin-right-#{$i}-#{$count}#{$suffix} {
|
33
|
+
// margin-right: math.div(100%, $count) * $i;
|
34
|
+
// }
|
35
|
+
|
36
|
+
// .column--margin-left-#{$i}-#{$count}#{$suffix} {
|
37
|
+
// margin-left: math.div(100%, $count) * $i;
|
38
|
+
// }
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
@mixin grid-medium {
|
44
|
+
.tna-column--width-full-medium {
|
45
|
+
width: 100%;
|
46
|
+
}
|
47
|
+
|
48
|
+
@for $i from 1 through 3 {
|
49
|
+
.tna-column--flex-#{$i}-medium {
|
50
|
+
flex: $i 0;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// @for $i from 1 through 3 {
|
55
|
+
// .column--order-#{$i}-medium {
|
56
|
+
// order: $i;
|
57
|
+
// }
|
58
|
+
// }
|
59
|
+
|
60
|
+
@include columns-generator($column-count-medium, "-medium");
|
61
|
+
}
|
62
|
+
|
63
|
+
@mixin grid-mobile {
|
64
|
+
.tna-container {
|
65
|
+
padding-right: math.div($gutter-width-mobile, 2) + 0.75rem;
|
66
|
+
padding-left: math.div($gutter-width-mobile, 2) + 0.75rem;
|
67
|
+
}
|
68
|
+
|
69
|
+
.tna-column {
|
70
|
+
padding-right: math.div($gutter-width-mobile, 2);
|
71
|
+
padding-left: math.div($gutter-width-mobile, 2);
|
72
|
+
}
|
73
|
+
|
74
|
+
// .column--width-full-mobile {
|
75
|
+
// width: 100%;
|
76
|
+
// }
|
77
|
+
|
78
|
+
// @for $i from 1 through 3 {
|
79
|
+
// .column--flex-#{$i}-mobile {
|
80
|
+
// flex: $i 0;
|
81
|
+
// }
|
82
|
+
// }
|
83
|
+
|
84
|
+
// @for $i from 1 through 3 {
|
85
|
+
// .column--order-#{$i}-mobile {
|
86
|
+
// order: $i;
|
87
|
+
// }
|
88
|
+
// }
|
89
|
+
}
|
90
|
+
|
91
|
+
@mixin grid-small {
|
92
|
+
.tna-column--width-full-small {
|
93
|
+
width: 100%;
|
94
|
+
}
|
95
|
+
|
96
|
+
@for $i from 1 through 3 {
|
97
|
+
.tna-column--flex-#{$i}-small {
|
98
|
+
flex: $i 0;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
// @for $i from 1 through 3 {
|
103
|
+
// .column--order-#{$i}-small {
|
104
|
+
// order: $i;
|
105
|
+
// }
|
106
|
+
// }
|
107
|
+
|
108
|
+
@include columns-generator($column-count-small, "-small");
|
109
|
+
}
|
110
|
+
|
111
|
+
@mixin grid-tiny {
|
112
|
+
.tna-column--width-full-tiny {
|
113
|
+
width: 100%;
|
114
|
+
}
|
115
|
+
|
116
|
+
@for $i from 1 through 3 {
|
117
|
+
.tna-column--flex-#{$i}-tiny {
|
118
|
+
width: auto;
|
119
|
+
|
120
|
+
flex: $i 0;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
// @for $i from 1 through 3 {
|
125
|
+
// .column--order-#{$i}-tiny {
|
126
|
+
// order: $i;
|
127
|
+
// }
|
128
|
+
// }
|
129
|
+
|
130
|
+
@include columns-generator($column-count-tiny, "-tiny");
|
131
|
+
}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
// Temporary - will eventually bundle font files into package
|
2
|
+
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap");
|
3
|
+
|
4
|
+
.tna-template {
|
5
|
+
font-family: "Open Sans", sans-serif;
|
6
|
+
font-size: 16px;
|
7
|
+
-moz-osx-font-smoothing: grayscale;
|
8
|
+
-webkit-font-smoothing: antialiased;
|
9
|
+
text-rendering: optimizeLegibility;
|
10
|
+
-webkit-text-size-adjust: none;
|
11
|
+
direction: ltr;
|
12
|
+
}
|
13
|
+
|
14
|
+
.tna-template__body {
|
15
|
+
font-size: 1rem;
|
16
|
+
line-height: 1.6;
|
17
|
+
}
|
18
|
+
|
19
|
+
.tna-heading {
|
20
|
+
}
|
21
|
+
|
22
|
+
.tna-heading--xl {
|
23
|
+
font-size: 4rem;
|
24
|
+
}
|
25
|
+
|
26
|
+
.tna-heading--l {
|
27
|
+
font-size: 2rem;
|
28
|
+
}
|
29
|
+
|
30
|
+
.tna-heading--m {
|
31
|
+
font-size: 1.3rem;
|
32
|
+
}
|
33
|
+
|
34
|
+
.tna-heading--s {
|
35
|
+
font-size: 1.125rem;
|
36
|
+
}
|
37
|
+
|
38
|
+
.tna-hgroup {
|
39
|
+
}
|
40
|
+
|
41
|
+
.tna-hgroup--xl {
|
42
|
+
.tna-hgroup__supertitle {
|
43
|
+
}
|
44
|
+
|
45
|
+
.tna-hgroup__title {
|
46
|
+
font-size: 4rem;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
.tna-hgroup--l {
|
51
|
+
.tna-hgroup__supertitle {
|
52
|
+
}
|
53
|
+
|
54
|
+
.tna-hgroup__title {
|
55
|
+
font-size: 2rem;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
.tna-hgroup--m {
|
60
|
+
.tna-hgroup__supertitle {
|
61
|
+
}
|
62
|
+
|
63
|
+
.tna-hgroup__title {
|
64
|
+
font-size: 1.3rem;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
.tna-hgroup--s {
|
69
|
+
.tna-hgroup__supertitle {
|
70
|
+
}
|
71
|
+
|
72
|
+
.tna-hgroup__title {
|
73
|
+
font-size: 1.125rem;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
.tna-hgroup__supertitle {
|
78
|
+
text-transform: uppercase;
|
79
|
+
}
|
80
|
+
|
81
|
+
.tna-hgroup__title {
|
82
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
$largest-medium-device: 1024px;
|
2
|
+
$largest-small-device: 768px;
|
3
|
+
$largest-tiny-device: 480px;
|
4
|
+
|
5
|
+
$media-large: "(min-width: #{$largest-medium-device + 1px})";
|
6
|
+
$media-lt-large: "(max-width: #{$largest-medium-device})";
|
7
|
+
$media-medium: "(min-width: #{$largest-small-device + 1px}) and (max-width: #{$largest-medium-device})";
|
8
|
+
$media-gt-mobile: "(min-width: #{$largest-small-device + 1px})";
|
9
|
+
$media-mobile: "(max-width: #{$largest-small-device})";
|
10
|
+
$media-small: "(min-width: #{$largest-tiny-device + 1px}) and (max-width: #{$largest-small-device})";
|
11
|
+
$media-gt-tiny: "(min-width: #{$largest-tiny-device + 1px})";
|
12
|
+
$media-tiny: "(max-width: #{$largest-tiny-device})";
|
package/package.json
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "@nationalarchives/frontend",
|
3
|
+
"version": "0.1.3-prerelease",
|
4
|
+
"description": "The National Archives frontend styles",
|
5
|
+
"scripts": {
|
6
|
+
"start": "storybook dev -p 6006",
|
7
|
+
"build": "storybook build -o storybook",
|
8
|
+
"lint": "prettier --check '{src,.storybook,tasks}/**/*.{js,mjs,scss,json}'",
|
9
|
+
"test": "node tasks/test-fixtures.js",
|
10
|
+
"prettier": "prettier --write '{src,.storybook,tasks}/**/*.{js,mjs,scss,json}'",
|
11
|
+
"package:sass": "sass --style=compressed --quiet-deps --load-path=node_modules src/nationalarchives/all.scss package/nationalarchives/all.css",
|
12
|
+
"package:scripts": "webpack"
|
13
|
+
},
|
14
|
+
"repository": {
|
15
|
+
"type": "git",
|
16
|
+
"url": "git+https://github.com/nationalarchives/tna-frontend.git"
|
17
|
+
},
|
18
|
+
"author": {
|
19
|
+
"name": "Andrew Hosgood",
|
20
|
+
"email": "andrew.hosgood@nationalarchives.gov.uk",
|
21
|
+
"url": "https://andrewhosgood.dev"
|
22
|
+
},
|
23
|
+
"license": "MIT",
|
24
|
+
"bugs": {
|
25
|
+
"url": "https://github.com/nationalarchives/tna-frontend/issues"
|
26
|
+
},
|
27
|
+
"main": "nationalarchives/all.js",
|
28
|
+
"exports": {
|
29
|
+
".": {
|
30
|
+
"sass": "./nationalarchives/all.scss",
|
31
|
+
"require": "./nationalarchives/all.js"
|
32
|
+
},
|
33
|
+
"./nationalarchives/": "./nationalarchives/"
|
34
|
+
},
|
35
|
+
"sass": "nationalarchives/all.scss",
|
36
|
+
"engines": {
|
37
|
+
"npm": "8.x",
|
38
|
+
"node": "18.x"
|
39
|
+
},
|
40
|
+
"homepage": "https://github.com/nationalarchives/tna-frontend#readme",
|
41
|
+
"devDependencies": {
|
42
|
+
"@babel/core": "^7.19.1",
|
43
|
+
"@babel/preset-env": "^7.22.5",
|
44
|
+
"@mdx-js/react": "^2.1.3",
|
45
|
+
"@storybook/addon-a11y": "^7.0.22",
|
46
|
+
"@storybook/addon-docs": "^7.0.22",
|
47
|
+
"@storybook/addon-essentials": "^7.0.22",
|
48
|
+
"@storybook/addon-links": "^7.0.22",
|
49
|
+
"@storybook/addon-mdx-gfm": "^7.0.22",
|
50
|
+
"@storybook/html": "^7.0.22",
|
51
|
+
"@storybook/html-webpack5": "^7.0.22",
|
52
|
+
"@storybook/testing-library": "^0.2.0",
|
53
|
+
"babel-loader": "^9.0.1",
|
54
|
+
"copy-webpack-plugin": "^11.0.0",
|
55
|
+
"css-loader": "^6.7.1",
|
56
|
+
"diff": "^5.1.0",
|
57
|
+
"glob": "^10.2.7",
|
58
|
+
"nunjucks": "^3.2.3",
|
59
|
+
"prettier": "^2.7.1",
|
60
|
+
"react": "^18.2.0",
|
61
|
+
"react-dom": "^18.2.0",
|
62
|
+
"sass": "^1.54.9",
|
63
|
+
"sass-loader": "^13.0.2",
|
64
|
+
"simple-nunjucks-loader": "^3.2.0",
|
65
|
+
"storybook": "^7.0.22",
|
66
|
+
"style-loader": "^3.3.1",
|
67
|
+
"webpack": "^5.74.0",
|
68
|
+
"webpack-cli": "^5.1.4"
|
69
|
+
}
|
70
|
+
}
|