@nationalarchives/frontend 0.1.3-prerelease → 0.1.6-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 +1 -168
  2. package/govuk-prototype-kit.config.json +10 -2
  3. package/nationalarchives/all.css +1 -1
  4. package/nationalarchives/all.css.map +1 -1
  5. package/nationalarchives/all.scss +4 -8
  6. package/nationalarchives/components/_all.scss +5 -7
  7. package/nationalarchives/components/button/_index.scss +15 -16
  8. package/nationalarchives/components/button/button.stories.js +1 -2
  9. package/nationalarchives/components/card/_index.scss +71 -24
  10. package/nationalarchives/components/card/card.stories.js +41 -10
  11. package/nationalarchives/components/card/fixtures.json +135 -7
  12. package/nationalarchives/components/card/macro-options.json +42 -10
  13. package/nationalarchives/components/card/template.njk +53 -24
  14. package/nationalarchives/components/footer/_index.scss +61 -51
  15. package/nationalarchives/components/footer/fixtures.json +1 -1
  16. package/nationalarchives/components/footer/footer.stories.js +22 -2
  17. package/nationalarchives/components/footer/macro-options.json +12 -0
  18. package/nationalarchives/components/footer/template.njk +16 -5
  19. package/nationalarchives/components/grid/_index.scss +127 -52
  20. package/nationalarchives/components/grid/grid.stories.js +2 -3
  21. package/nationalarchives/components/sensitive-image/_index.scss +55 -58
  22. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -2
  23. package/nationalarchives/stories/design/about.mdx +25 -0
  24. package/nationalarchives/stories/development/about.mdx +62 -0
  25. package/nationalarchives/stories/development/dependencies.mdx +9 -0
  26. package/nationalarchives/stories/development/publishing.mdx +16 -0
  27. package/nationalarchives/stories/development/relationships.md +91 -0
  28. package/nationalarchives/stories/development/structure.mdx +2 -2
  29. package/nationalarchives/stories/utilities/heading-groups.stories.js +44 -0
  30. package/nationalarchives/stories/{global → utilities}/headings.stories.js +1 -1
  31. package/nationalarchives/stories/utilities/lists.stories.js +38 -0
  32. package/nationalarchives/stories/{global → utilities}/typography.mdx +8 -8
  33. package/nationalarchives/stories/utilities/typography.stories.js +14 -0
  34. package/nationalarchives/templates/homepage.njk +64 -0
  35. package/nationalarchives/templates/layouts/_generic.njk +60 -0
  36. package/nationalarchives/tools/_all.scss +2 -1
  37. package/nationalarchives/tools/_grid.scss +44 -0
  38. package/nationalarchives/tools/_typography.scss +6 -0
  39. package/nationalarchives/utilities/_all.scss +2 -3
  40. package/nationalarchives/utilities/_global.scss +8 -0
  41. package/nationalarchives/utilities/_typography.scss +126 -18
  42. package/nationalarchives/variables/_all.scss +3 -2
  43. package/nationalarchives/variables/_grid.scss +7 -7
  44. package/nationalarchives/variables/_media.scss +11 -11
  45. package/nationalarchives/variables/_typography.scss +10 -0
  46. package/package.json +2 -2
  47. package/nationalarchives/_base.scss +0 -6
  48. package/nationalarchives/_prototype-kit.scss +0 -3
  49. package/nationalarchives/components/button/_button.scss +0 -2
  50. package/nationalarchives/components/card/_card.scss +0 -2
  51. package/nationalarchives/components/footer/_footer.scss +0 -2
  52. package/nationalarchives/components/grid/_grid.scss +0 -2
  53. package/nationalarchives/components/sensitive-image/_sensitive-image.scss +0 -2
  54. package/nationalarchives/stories/global/heading-groups.stories.js +0 -23
  55. package/nationalarchives/stories/global/typography.stories.js +0 -15
  56. package/nationalarchives/tools/_exports.scss +0 -36
  57. package/nationalarchives/utilities/_grid.scss +0 -131
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The National Archives Frontend
4
4
 
5
- [![Main build status](https://github.com/nationalarchives/tna-frontend/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/nationalarchives/tna-frontend/actions/workflows/test.yml?query=branch%3Amain)
5
+ [![Main build status](https://github.com/nationalarchives/tna-frontend/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/nationalarchives/tna-frontend/actions/workflows/ci.yml?query=branch%3Amain)
6
6
  [![Latest release](https://img.shields.io/github/v/release/nationalarchives/tna-frontend?style=flat-square&logo=github&logoColor=white&sort=semver)](https://github.com/nationalarchives/tna-frontend/releases)
7
7
  [![NPM version](https://img.shields.io/npm/v/@nationalarchives/frontend?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@nationalarchives/frontend)
8
8
  [![Node version](https://img.shields.io/node/v-lts/@nationalarchives/frontend?style=flat-square&logo=nodedotjs&logoColor=white)](https://github.com/nationalarchives/tna-frontend/blob/main/.nvmrc)
@@ -22,170 +22,3 @@ npm install
22
22
  # Start Storybook
23
23
  npm start
24
24
  ```
25
-
26
- ### Updating
27
-
28
- ```sh
29
- # Upgrade all Storybook packages
30
- npx sb upgrade
31
- ```
32
-
33
- ### Release
34
-
35
- ```sh
36
- # Update version in package.json
37
- npm install
38
- # Commit and push to main
39
- git tag v0.1.0
40
- git push origin --tags
41
- # Create a new release on GitHub: https://github.com/nationalarchives/tna-frontend/releases/new
42
- ```
43
-
44
- ## Needs
45
-
46
- TNA needs a frontend toolkit that is:
47
-
48
- - standardised - a single source of truth for all TNA that follows all our coding standards (currently non-existent)
49
- - version controlled - as well as [semantically versioned](https://semver.org/) with a [changelog](https://keepachangelog.com/en/1.0.0/)
50
- - open - all source code should be [open and available to anyone](https://www.gov.uk/service-manual/service-standard/point-12-make-new-source-code-open)
51
- - accessible - all components meet WCAG 2.1 AA standards
52
- - progressively enhanced - all components should still be operable without JavaScript, CSS or both
53
- - importable into projects (via a service such as [NPM](https://www.npmjs.com/search?q=nationalarchives)) - to make dependency management as simple as possible
54
- - agnostic - the implementation for the markup of the components can be replicated in any required technology (because we have Python, PHP and Java applications throughout the organisation)
55
- - testable - both from an internal perspective as well as providing scenarios and expected results for language implimentations to be able to validate against
56
- - lean - minimal reliance on other languages and dependencies to ensure good extendability and speed of development and deployment
57
- - automatically published - leveraging CI/CD, creating a new release version should be as simple as possible
58
-
59
- It would also be nice to have a toolkit that is:
60
-
61
- - extendable - rather than providing a static snapshot of the toolkit, we should always be able to extend it for any given application
62
- - documentable - not just from a technical perspective but also from a user-centred design perspective with best practices of when and how to use each component (this might be a separate project where we can [share information such as user research](https://www.gov.uk/service-manual/service-standard/point-13-use-common-standards-components-patterns))
63
- - prototype-able - by using Nunjucks, we could easily create a toolkit that integrated with the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk/docs/) which means we could very easily create high fidelity prototypes to test with, ultimately helping with user research
64
-
65
- ## Current solutions
66
-
67
- There is already a solution in [nationalarchives/tdr-components](https://github.com/nationalarchives/tdr-components) which is specific to TDR and extends the GOV.UK components and styles. We need to create a more generic set of components that are suitable for every TNA service, while still extending the GOV.UK components and styles but with a more TNA-branded look and feel.
68
-
69
- We also have [nationalarchives/tna-frontend-design-toolkit](https://github.com/nationalarchives/tna-frontend-design-toolkit) which aims to provide similar functionality but isn't as featureful as we need and isn't published to NPM which means it has to be [copied into the projects that require it](https://github.com/nationalarchives/ds-wagtail/tree/develop/sass/tna-toolkit).
70
-
71
- ## Proposed solution
72
-
73
- This repository should hold all the JavaScript and SCSS source files required for all the frontend styles along with tests and expected markup.
74
-
75
- ### Output
76
-
77
- The source files will be compiled down to a NodeJS package and deployed to [NPM](https://www.npmjs.com/). The package will contain:
78
-
79
- - All the JavaScript and SCSS source files which can be imported into a projects source code and compiled by the project (which will allow for tree shaking and application-specific modifications)
80
- - An AMD/UMD/IIFE (TBD) ES5 JavaScript file which can be included with a normal `<script>` element
81
- - A single CSS file containing all the styles which can be included with a normal `<style>` element
82
- - The Nunjucks templates for each component that might be required in other projects such as prototyping tools (other implementations can be made such as [Jinja templates](https://github.com/nationalarchives/tna-frontend-jinja))
83
-
84
- ### Component resources
85
-
86
- Each component in this repository should contain:
87
-
88
- - Nunjucks template - only used to display the component within the examples page and aid development
89
- - SCSS - which could either be imported as a standalone styles declaration or as part of the compiled output
90
- - JavaScript (ESNext) - if there is any progressive enhancement required on the component
91
- - Options/properties - a list of the configurable properties of the component and their types
92
- - Test scenarios - a variety of configurations and their expected outputs that can be used by either this repository or other implementations of the components (e.g. Jinja)
93
-
94
- ### Technologies
95
-
96
- - SCSS (used by GDS, is the de facto standard CSS preprocessor, already using in ETNA)
97
- - Webpack - compilation of JavaScript and CSS (used by numerous TNA projects already)
98
- - Babel - will allow us to use ESNext or possibly even TypeScript (although this could go against the lean requirement)
99
- - Storybook - allow viewing and testing of components (we have already used this elsewhere in TNA)
100
-
101
- ### Relationship to other resources
102
-
103
- #### System context
104
-
105
- ```mermaid
106
- C4Context
107
- Person(dev, "Developer", "TNA developer")
108
- System_Ext(github, "GitHub", "Repositories for source files")
109
- System_Ext(npm, "NPMJS", "Hosts NodeJS packages")
110
- System_Ext(pypi, "PyPi", "Hosts Python packages")
111
- Container(app, "Application", "Example application")
112
- System_Ext(pypi, "PyPi", "Hosts Python packages")
113
-
114
- Rel(dev, github, "commits to", "git")
115
- UpdateRelStyle(dev, github, $offsetX="-30", $offsetY="-30")
116
- Rel(github, npm, "publishes to", "npm")
117
- Rel(github, pypi, "publishes to", "pip")
118
- Rel(app, npm, "consumes", "npm")
119
- Rel(app, pypi, "consumes", "pip")
120
-
121
- UpdateLayoutConfig($c4ShapeInRow="2")
122
- ```
123
-
124
- #### Component diagram
125
-
126
- ```mermaid
127
- C4Context
128
- Person(dev, "Developer", "TNA developer")
129
-
130
- %% Boundary(developer_machine, "Developer machine", "boundary") {
131
- %% System(docker, "Docker")
132
- %% }
133
-
134
- Boundary(github, "GitHub", "boundary") {
135
- Boundary(github_jinja, "Jinja templates", "repository") {
136
- Container(github_jinja_source, "Jinja templates")
137
- }
138
-
139
- Boundary(github_frontend, "Frontend styles", "repository") {
140
- Container(github_frontend_source, "Frontend styles", "git repository")
141
- }
142
-
143
- Boundary(github_application, "Application", "repository") {
144
- Container(github_application_source, "Application source code")
145
- Component(github_application_image, "Application docker image", "GitHub image registry")
146
- }
147
- }
148
-
149
- Boundary(npm, "NPMJS", "boundary") {
150
- Component(npm_package, "Frontend styles")
151
- }
152
-
153
- Enterprise_Boundary(aws, "TNA AWS", "boundary") {
154
- Container(app, "Application")
155
- }
156
-
157
- Boundary(pypi, "PyPi", "boundary") {
158
- Component(pypi_package, "Jinja templates")
159
- }
160
-
161
- Rel(dev, github_frontend_source, "commits to")
162
- UpdateRelStyle(dev, github_frontend_source, $offsetX="-80", $offsetY="-80")
163
- Rel(github_frontend_source, npm_package, "publishes", "GitHub action")
164
- UpdateRelStyle(github_frontend_source, npm_package, $offsetX="-40", $offsetY="-40")
165
-
166
- Rel(dev, github_jinja_source, "commits to")
167
- UpdateRelStyle(dev, github_jinja_source, $offsetX="-15", $offsetY="-80")
168
- Rel(github_jinja_source, github_frontend_source, "consumes")
169
- UpdateRelStyle(github_jinja_source, github_frontend_source, $offsetX="-40", $offsetY="-15")
170
- Rel(github_jinja_source, pypi_package, "publishes", "GitHub action")
171
- UpdateRelStyle(github_jinja_source, pypi_package, $offsetX="-110", $offsetY="-310")
172
-
173
- Rel(dev, github_application_source, "commits to")
174
- UpdateRelStyle(dev, github_application_source, $offsetX="-105", $offsetY="-250")
175
- Rel(github_application_source, github_application_image, "creates", "GitHub action")
176
- UpdateRelStyle(github_application_source, github_application_image, $offsetX="-90", $offsetY="-20")
177
-
178
- Rel(github_application_image, npm_package, "consumes", "GitHub action")
179
- UpdateRelStyle(github_application_image, npm_package, $offsetX="-50", $offsetY="-10")
180
- Rel(github_application_image, pypi_package, "consumes", "GitHub action")
181
- UpdateRelStyle(github_application_image, pypi_package, $offsetX="-120", $offsetY="-10")
182
-
183
- %% Rel(dev, docker, "uses")
184
- %% Rel(docker, npm_package, "consumes")
185
- %% Rel(docker, pypi_package, "consumes")
186
-
187
- Rel(app, github_application_image, "consumes")
188
- UpdateRelStyle(app, github_application_image, $offsetX="-70", $offsetY="-10")
189
-
190
- UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
191
- ```
@@ -9,6 +9,14 @@
9
9
  "/nationalarchives/assets"
10
10
  ],
11
11
  "sass": [
12
- "/nationalarchives/_prototype-kit.scss"
13
- ]
12
+ "/nationalarchives/all.scss"
13
+ ],
14
+ "stylesheets": [
15
+ "/nationalarchives/all.css"
16
+ ],
17
+ "templates": {
18
+ "name": "National Archives homepage",
19
+ "path": "/nationalarchives/templates/homepage.njk",
20
+ "type": "nunjucks"
21
+ }
14
22
  }
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";.tna-template{min-width:320px;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}@media(prefers-reduced-motion){.tna-template *{animation:none !important;transition:none !important}}.tna-template__body{margin:0;padding:0;background-color:#fff;overflow:auto}img,svg,video,canvas{max-width:100%;display:block}video,canvas{width:100%}.tna-template{font-family:"Open Sans",sans-serif;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;direction:ltr}.tna-template__body{font-size:1rem;line-height:1.6}.tna-heading--xl{font-size:4rem}.tna-heading--l{font-size:2rem}.tna-heading--m{font-size:1.3rem}.tna-heading--s{font-size:1.125rem}.tna-hgroup--xl .tna-hgroup__title{font-size:4rem}.tna-hgroup--l .tna-hgroup__title{font-size:2rem}.tna-hgroup--m .tna-hgroup__title{font-size:1.3rem}.tna-hgroup--s .tna-hgroup__title{font-size:1.125rem}.tna-hgroup__supertitle{text-transform:uppercase}.tna-container{max-width:75.25rem;width:100%;margin-right:auto;margin-left:auto;padding-right:1rem;padding-left:1rem;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-wrap:wrap;justify-content:stretch;align-items:stretch}.tna-container.tna-container--max{max-width:none}.tna-container.tna-container--no-padding{max-width:71.25rem;padding-right:0;padding-left:0}.tna-container.tna-container--no-padding .tna-column{padding-right:0;padding-left:0}.tna-column{padding-right:1rem;padding-left:1rem;box-sizing:border-box}.tna-column.tna-column--full{width:100%}.tna-column--flex-1{flex:1 0}.tna-column--flex-2{flex:2 0}.tna-column--flex-3{flex:3 0}.tna-column--width-1-12{width:8.3333333333%}.tna-column--width-1-6{width:16.6666666667%}.tna-column--width-1-4{width:25%}.tna-column--width-1-3{width:33.3333333333%}.tna-column--width-5-12{width:41.6666666667%}.tna-column--width-1-2{width:50%}.tna-column--width-7-12{width:58.3333333333%}.tna-column--width-2-3{width:66.6666666667%}.tna-column--width-3-4{width:75%}.tna-column--width-5-6{width:83.3333333333%}.tna-column--width-11-12{width:91.6666666667%}@media(min-width: 769px)and (max-width: 1024px){.tna-column--width-full-medium{width:100%}.tna-column--flex-1-medium{flex:1 0}.tna-column--flex-2-medium{flex:2 0}.tna-column--flex-3-medium{flex:3 0}.tna-column--width-1-6-medium{width:16.6666666667%}.tna-column--width-1-3-medium{width:33.3333333333%}.tna-column--width-1-2-medium{width:50%}.tna-column--width-2-3-medium{width:66.6666666667%}.tna-column--width-5-6-medium{width:83.3333333333%}}@media(max-width: 768px){.tna-container{padding-right:1.125rem;padding-left:1.125rem}.tna-column{padding-right:.375rem;padding-left:.375rem}}@media(min-width: 481px)and (max-width: 768px){.tna-column--width-full-small{width:100%}.tna-column--flex-1-small{flex:1 0}.tna-column--flex-2-small{flex:2 0}.tna-column--flex-3-small{flex:3 0}.tna-column--width-1-4-small{width:25%}.tna-column--width-1-2-small{width:50%}.tna-column--width-3-4-small{width:75%}}@media(max-width: 480px){.tna-column--width-full-tiny{width:100%}.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--width-1-2-tiny{width:50%}}.tna-card{display:-ms-flexbox;display:flex;-ms-box-orient:vertical;-ms-flex-direction:column;flex-direction:column}.tna-card__heading{order:2}.tna-card__image{order:1}.tna-card__body{order:3}.tna-card__actions{order:4}/*# sourceMappingURL=all.css.map */
1
+ @import"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";@import"https://use.typekit.net/hkj3kuz.css";.tna-template{min-width:320px;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:16}@media(prefers-reduced-motion){.tna-template *{animation:none !important;transition:none !important}}.tna-template__body{margin:0;padding:0;background-color:#fff;overflow:auto}img,svg,video,canvas{max-width:100%;display:block}video,canvas{width:100%}*:focus{outline:3px #f0a solid}.tna-template{font-family:"Open Sans",sans-serif;font-weight:400;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;direction:ltr}.tna-template h1,.tna-template h2,.tna-template h3,.tna-template h4,.tna-template h5,.tna-template h6,.tna-template p,.tna-template ul,.tna-template ol{margin:0 0 2rem}.tna-template h1:last-child,.tna-template h2:last-child,.tna-template h3:last-child,.tna-template h4:last-child,.tna-template h5:last-child,.tna-template h6:last-child,.tna-template p:last-child,.tna-template ul:last-child,.tna-template ol:last-child{margin-bottom:0}.tna-template a:hover,.tna-template a:link:hover{text-decoration-thickness:3px}.tna-template a:active,.tna-template a:link:active{text-decoration-thickness:4px}.tna-template ul,.tna-ul,.tna-template ol,.tna-ol{padding-left:2rem}.tna-template ul li::marker,.tna-ul li::marker,.tna-template ol li::marker,.tna-ol li::marker{color:#f0a;font-weight:700}.tna-template .tna-ul--plain,.tna-template .tna-ol--plain{padding-left:0;list-style:none}.tna-template__body{font-size:1rem;line-height:1.6}.tna-heading{margin-bottom:2rem;font-family:supria-sans-condensed,monospace;font-weight:600}.tna-heading--xl{font-size:4rem}.tna-heading--l{font-size:2rem}.tna-heading--m{font-size:1.25rem}.tna-heading--s{font-size:1.125rem}.tna-hgroup__supertitle{font-size:0.875rem;font-family:"Roboto Mono",monospace;font-weight:500;text-transform:uppercase}.tna-hgroup .tna-hgroup__supertitle{margin:0}.tna-hgroup__title .tna-hgroup__supertitle{display:block}.tna-hgroup--xl .tna-hgroup__title{font-size:4rem}.tna-hgroup--l .tna-hgroup__title{font-size:2rem}.tna-hgroup--m .tna-hgroup__title{font-size:1.25rem}.tna-hgroup--s .tna-hgroup__title{font-size:1.125rem}.tna-button{padding:.25rem 1rem;display:inline-block;color:#fff;font-weight:700;text-decoration:none;background-color:#000}.tna-button:hover{background-color:#069}.tna-button--secondary{color:#000;background-color:#ff0}.tna-button--secondary:hover{color:#fff}.tna-card__inner{display:-ms-flexbox;display:flex;-ms-box-orient:vertical;-ms-flex-direction:column;flex-direction:column}.tna-card__heading{order:2}.tna-card__title{order:2}.tna-card__image-container{order:1}.tna-card__body{margin-top:2rem;order:3}.tna-card__actions{margin-top:2rem;order:4}.tna-card--featured{padding-left:50%;position:relative;background-color:#ff0}.tna-card--featured .tna-card__inner{padding:2rem}.tna-card--featured .tna-card__heading{padding-bottom:2rem;border-bottom:2px #000 solid}.tna-card--featured .tna-card__image-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:50%;bottom:0;left:0}.tna-card--featured .tna-card__image{width:100%;height:100%;object-fit:cover}.tna-footer{padding-top:3rem;padding-bottom:3rem;color:#fff;background-color:#26262a}.tna-footer__link{color:inherit}.tna-footer__link:hover{color:#f0a}.tna-footer__navigation{padding-bottom:3rem}.tna-footer__navigation-group-items{padding-left:0;list-style:none}.tna-footer__social{padding-bottom:4rem}.tna-footer__social.tna-container{align-items:flex-end}.tna-footer__social-item{text-align:center}.tna-footer__social-item-link{display:block}.tna-footer__social-item-link-image{display:block}.tna-footer__licence.tna-container{align-items:center}.tna-footer__licence-logo{display:block}.tna-footer__govuk-link{display:inline-block;color:inherit;fill:#fff}.tna-footer__govuk-link:hover{color:#f0a;fill:#f0a}.tna-footer__govuk-logotype-crown{margin:0 auto;display:block;fill:inherit}.tna-container{max-width:75.25rem;width:100%;margin-right:auto;margin-left:auto;padding-right:1rem;padding-left:1rem;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-wrap:wrap;justify-content:stretch;align-items:stretch}.tna-container.tna-container--max{max-width:none}.tna-container.tna-container--no-padding{max-width:71.25rem;padding-right:0;padding-left:0}.tna-container.tna-container--no-padding .tna-column{padding-right:0;padding-left:0}.tna-column{padding-right:1rem;padding-left:1rem;box-sizing:border-box}.tna-column.tna-column--full{width:100%}.tna-column--flex-1{flex:1 0}.tna-column--flex-2{flex:2 0}.tna-column--flex-3{flex:3 0}.tna-column--width-1-12{width:8.3333333333%;flex:none}.tna-column--width-1-6{width:16.6666666667%;flex:none}.tna-column--width-1-4{width:25%;flex:none}.tna-column--width-1-3{width:33.3333333333%;flex:none}.tna-column--width-5-12{width:41.6666666667%;flex:none}.tna-column--width-1-2{width:50%;flex:none}.tna-column--width-7-12{width:58.3333333333%;flex:none}.tna-column--width-2-3{width:66.6666666667%;flex:none}.tna-column--width-3-4{width:75%;flex:none}.tna-column--width-5-6{width:83.3333333333%;flex:none}.tna-column--width-11-12{width:91.6666666667%;flex:none}@media(min-width: 769px)and (max-width: 1024px){.tna-column--full-medium{width:100%;flex:none}.tna-column--flex-1-medium{flex:1 0}.tna-column--flex-2-medium{flex:2 0}.tna-column--flex-3-medium{flex:3 0}.tna-column--width-1-6-medium{width:16.6666666667%;flex:none}.tna-column--width-1-3-medium{width:33.3333333333%;flex:none}.tna-column--width-1-2-medium{width:50%;flex:none}.tna-column--width-2-3-medium{width:66.6666666667%;flex:none}.tna-column--width-5-6-medium{width:83.3333333333%;flex:none}}@media(max-width: 768px){.tna-container{padding-right:1.125rem;padding-left:1.125rem}.tna-column{padding-right:.375rem;padding-left:.375rem}}@media(min-width: 481px)and (max-width: 768px){.tna-column--full-small{width:100%;flex:none}.tna-column--flex-1-small{flex:1 0}.tna-column--flex-2-small{flex:2 0}.tna-column--flex-3-small{flex:3 0}.tna-column--width-1-4-small{width:25%;flex:none}.tna-column--width-1-2-small{width:50%;flex:none}.tna-column--width-3-4-small{width:75%;flex:none}}@media(max-width: 480px){.tna-column--full-tiny{width:100%;flex:none}.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--width-1-2-tiny{width:50%;flex:none}}.tna-sensitive-image__details{position:relative}.tna-sensitive-image__details::after{width:100%;padding-bottom:calc(100%*var(--sensitive-image-height)/var(--sensitive-image-width));display:block;position:relative;z-index:-1;background-image:var(--sensitive-image);background-clip:padding-box;background-size:contain;filter:blur(20px) saturate(0);content:""}.tna-sensitive-image__show{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;font-size:0;cursor:pointer}.tna-sensitive-image__show::after{padding:.5rem 2rem;font-size:1rem;background-color:#ff0;content:attr(data-action)}.tna-sensitive-image__show:hover::after{color:#fff;background-color:#000}.tna-sensitive-image__image{width:100%}.tna-sensitive-image__details[open]::after,.tna-sensitive-image__details[open] .tna-sensitive-image__show{display:none}/*# sourceMappingURL=all.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/nationalarchives/utilities/_typography.scss","../../src/nationalarchives/utilities/_global.scss","../../src/nationalarchives/components/grid/_index.scss","../../src/nationalarchives/variables/_grid.scss","../../src/nationalarchives/utilities/_grid.scss","../../src/nationalarchives/components/card/_index.scss"],"names":[],"mappings":"AACQ,sHCDR,cACE,gBACA,WACA,YAEA,kBACA,gBACA,iCAEA,+BACE,gBACE,0BACA,4BAKN,oBACE,SACA,UAEA,sBAEA,cAGF,qBAIE,eAEA,cAGF,aAEE,WDlCF,cACE,mCACA,eACA,kCACA,mCACA,kCACA,8BACA,cAGF,oBACE,eACA,gBAMF,iBACE,eAGF,gBACE,eAGF,gBACE,iBAGF,gBACE,mBAUA,mCACE,eAQF,kCACE,eAQF,kCACE,iBAQF,kCACE,mBAIJ,wBACE,yBEvEA,eACE,UCPsB,SDQtB,WACA,kBACA,iBACA,mBACA,kBAEA,sBAEA,oBACA,aACA,eACA,wBACA,oBAEA,kCACE,eAGF,yCACE,mBACA,gBACA,eAEA,qDACE,gBACA,eAKN,YACE,mBACA,kBAEA,sBAEA,6BACE,WAUF,oBACE,SADF,oBACE,SADF,oBACE,SE9CE,wBACE,oBADF,uBACE,qBADF,uBACE,UADF,uBACE,qBADF,wBACE,qBADF,uBACE,UADF,wBACE,qBADF,uBACE,qBADF,uBACE,UADF,uBACE,qBADF,yBACE,qBFyDR,gDEzBA,+BACE,WAIA,2BACE,SADF,2BACE,SADF,2BACE,SAvCE,8BACE,qBADF,8BACE,qBADF,8BACE,UADF,8BACE,qBADF,8BACE,sBF6DR,yBETA,eACE,uBACA,sBAGF,YACE,sBACA,sBFMF,+CEeA,8BACE,WAIA,0BACE,SADF,0BACE,SADF,0BACE,SAvFE,6BACE,UADF,6BACE,UADF,6BACE,WFqER,yBE+BA,6BACE,WAIA,yBACE,WAEA,SAHF,yBACE,WAEA,SAHF,yBACE,WAEA,SA7GE,4BACE,WCVR,UACE,oBACA,aACA,wBACA,0BACA,sBAGF,mBACE,QAYF,iBACE,QAGF,gBACE,QAGF,mBACE","file":"all.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../src/nationalarchives/utilities/_typography.scss","../../src/nationalarchives/utilities/_global.scss","../../src/nationalarchives/variables/_typography.scss","../../src/nationalarchives/tools/_typography.scss","../../src/nationalarchives/components/button/_index.scss","../../src/nationalarchives/components/card/_index.scss","../../src/nationalarchives/components/footer/_index.scss","../../src/nationalarchives/components/grid/_index.scss","../../src/nationalarchives/variables/_grid.scss","../../src/nationalarchives/tools/_grid.scss","../../src/nationalarchives/components/sensitive-image/_index.scss"],"names":[],"mappings":"AAIQ,sHACA,6CCHR,cACE,gBACA,WACA,YAEA,kBACA,gBACA,iCAEA,UCXe,GDaf,+BACE,gBACE,0BACA,4BAKN,oBACE,SACA,UAEA,sBAEA,cAGF,qBAIE,eAEA,cAGF,aAEE,WAGF,QACE,uBDtCF,cACE,YENe,uBFOf,YENe,IFOf,kCACA,mCACA,kCACA,8BACA,cAEA,wJASE,gBAEA,2PACE,gBAOA,iDACE,8BAGF,mDACE,8BAgDR,kDAIE,kBAEA,8FACE,WACA,gBAIJ,0DAEE,eAEA,gBAGF,oBGvGE,eHyGA,gBAGF,aACE,mBAEA,YE9GkB,gCF+GlB,YE9GkB,IFiHpB,iBGnHE,eHuHF,gBGvHE,eH2HF,gBG3HE,kBH+HF,gBG/HE,mBHsIF,wBGtIE,mBHwIA,YEpIiB,wBFqIjB,YEpIiB,IFqIjB,yBAEA,oCACE,SAKF,2CACE,cAQF,mCG3JA,eHoKA,kCGpKA,eH6KA,kCG7KA,kBHsLA,kCGtLA,mBCJF,YACE,oBAEA,qBAEA,WACA,gBACA,qBAEA,sBAEA,kBACE,sBAIJ,uBACE,WAEA,sBAEA,6BACE,WCjBJ,iBACE,oBACA,aACA,wBACA,0BACA,sBAGF,mBACE,QAMF,iBACE,QAMF,2BACE,QAMF,gBACE,gBAEA,QAGF,mBACE,gBAEA,QAMF,oBACE,iBAEA,kBAEA,sBAEA,qCACE,aAGF,uCACE,oBAEA,6BAGF,+CACE,aACA,mBACA,uBAEA,kBACA,MACA,UACA,SACA,OAGF,qCACE,WACA,YACA,iBCjFJ,YACE,iBACA,oBAEA,WAEA,yBAGF,kBACE,cAEA,wBACE,WAIJ,wBACE,oBASF,oCACE,eAEA,gBASF,oBACE,oBAEA,kCACE,qBAIJ,yBACE,kBAGF,8BACE,cAGF,oCACE,cAIA,mCACE,mBAIJ,0BACE,cAGF,wBACE,qBAEA,cACA,UAEA,8BACE,WACA,UAIJ,kCACE,cACA,cAEA,aChFF,eACE,UCNwB,SDOxB,WACA,kBACA,iBACA,mBACA,kBAEA,sBAEA,oBACA,aACA,eACA,wBACA,oBAEA,kCACE,eAGF,yCACE,mBACA,gBACA,eAEA,qDACE,gBACA,eAKN,YACE,mBACA,kBAEA,sBAEA,6BACE,WAUF,oBACE,SADF,oBACE,SADF,oBACE,SE5CI,wBACE,oBACA,UAFF,uBACE,qBACA,UAFF,uBACE,UACA,UAFF,uBACE,qBACA,UAFF,wBACE,qBACA,UAFF,uBACE,UACA,UAFF,wBACE,qBACA,UAFF,uBACE,qBACA,UAFF,uBACE,UACA,UAFF,uBACE,qBACA,UAFF,yBACE,qBACA,UFsDV,gDACE,yBACE,WACA,UAIA,2BACE,SADF,2BACE,SADF,2BACE,SEhEE,8BACE,qBACA,UAFF,8BACE,qBACA,UAFF,8BACE,UACA,UAFF,8BACE,qBACA,UAFF,8BACE,qBACA,WF2EV,yBACE,eACE,uBACA,sBAGF,YACE,sBACA,sBAoBJ,+CACE,wBACE,WACA,UAIA,0BACE,SADF,0BACE,SADF,0BACE,SEjHE,6BACE,UACA,UAFF,6BACE,UACA,UAFF,6BACE,UACA,WF4HV,yBACE,uBACE,WACA,UAIA,yBACE,WAEA,SAHF,yBACE,WAEA,SAHF,yBACE,WAEA,SExIE,4BACE,UACA,WCLV,8BACE,kBAIA,qCACE,WACA,qFAIA,cAEA,kBACA,WAEA,wCACA,4BACA,wBAEA,8BAEA,WAIJ,2BACE,aACA,mBACA,uBAEA,kBACA,MACA,QACA,SACA,OACA,UAEA,YAEA,eAEA,kCACE,mBP/CF,eOkDE,sBAEA,0BAIA,wCACE,WAEA,sBAQN,4BACE,WAIA,0GAEE","file":"all.css"}
@@ -1,9 +1,5 @@
1
- // This gives us all the helpers and SASS
2
- // goodness from GovUK (thank you!)
3
- @import "base";
1
+ @use "tools/all" as tools;
2
+ @use "variables/all" as variables;
4
3
 
5
- @import "variables/all";
6
-
7
- @import "utilities/all";
8
-
9
- @import "components/all";
4
+ @use "utilities/all" as utilities;
5
+ @use "components/all" as components;
@@ -1,7 +1,5 @@
1
- @import "../base";
2
-
3
- // Utilities
4
- @import "grid/index";
5
-
6
- // Components
7
- @import "card/index";
1
+ @use "button/index" as button;
2
+ @use "card/index" as card;
3
+ @use "footer/index" as footer;
4
+ @use "grid/index" as grid;
5
+ @use "sensitive-image/index" as sensitive-image;
@@ -1,26 +1,25 @@
1
- @include nationalarchives-exports("nationalarchives/components/button") {
2
- .tna-button {
3
- padding: 0.25rem 1rem;
1
+ .tna-button {
2
+ padding: 0.25rem 1rem;
4
3
 
5
- display: inline-block;
4
+ display: inline-block;
6
5
 
7
- color: #fff;
8
- text-decoration: none;
6
+ color: #fff;
7
+ font-weight: 700;
8
+ text-decoration: none;
9
9
 
10
- background-color: #000;
10
+ background-color: #000;
11
11
 
12
- &:hover {
13
- background-color: #069;
14
- }
12
+ &:hover {
13
+ background-color: #069;
15
14
  }
15
+ }
16
16
 
17
- .tna-button--secondary {
18
- color: #000;
17
+ .tna-button--secondary {
18
+ color: #000;
19
19
 
20
- background-color: #ff0;
20
+ background-color: #ff0;
21
21
 
22
- &:hover {
23
- color: #fff;
24
- }
22
+ &:hover {
23
+ color: #fff;
25
24
  }
26
25
  }
@@ -1,6 +1,5 @@
1
1
  import Button from "./template.njk";
2
- import "../../all.scss";
3
- import "./_button.scss";
2
+ import "./_index.scss";
4
3
  import macroOptions from "./macro-options.json";
5
4
 
6
5
  const argTypes = {
@@ -1,37 +1,84 @@
1
- @include nationalarchives-exports("nationalarchives/components/card") {
2
- .tna-card {
3
- display: -ms-flexbox;
4
- display: flex;
5
- -ms-box-orient: vertical;
6
- -ms-flex-direction: column;
7
- flex-direction: column;
8
- }
1
+ @use "../../tools/typography" as typographyTools;
9
2
 
10
- .tna-card__heading {
11
- order: 2;
12
- }
3
+ .tna-card {
4
+ }
13
5
 
14
- .tna-card__supertitle {
15
- }
6
+ .tna-card__inner {
7
+ display: -ms-flexbox;
8
+ display: flex;
9
+ -ms-box-orient: vertical;
10
+ -ms-flex-direction: column;
11
+ flex-direction: column;
12
+ }
16
13
 
17
- .tna-card__title {
18
- }
14
+ .tna-card__heading {
15
+ order: 2;
16
+ }
19
17
 
20
- .tna-card__title-link {
21
- }
18
+ .tna-card__supertitle {
19
+ }
22
20
 
23
- .tna-card__image {
24
- order: 1;
21
+ .tna-card__title {
22
+ order: 2;
23
+ }
24
+
25
+ .tna-card__title-link {
26
+ }
27
+
28
+ .tna-card__image-container {
29
+ order: 1;
30
+ }
31
+
32
+ .tna-card__image {
33
+ }
34
+
35
+ .tna-card__body {
36
+ margin-top: 2rem;
37
+
38
+ order: 3;
39
+ }
40
+
41
+ .tna-card__actions {
42
+ margin-top: 2rem;
43
+
44
+ order: 4;
45
+ }
46
+
47
+ .tna-card__action {
48
+ }
49
+
50
+ .tna-card--featured {
51
+ padding-left: 50%;
52
+
53
+ position: relative;
54
+
55
+ background-color: #ff0;
56
+
57
+ .tna-card__inner {
58
+ padding: 2rem;
25
59
  }
26
60
 
27
- .tna-card__body {
28
- order: 3;
61
+ .tna-card__heading {
62
+ padding-bottom: 2rem;
63
+
64
+ border-bottom: 2px #000 solid;
29
65
  }
30
66
 
31
- .tna-card__actions {
32
- order: 4;
67
+ .tna-card__image-container {
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+
72
+ position: absolute;
73
+ top: 0;
74
+ right: 50%;
75
+ bottom: 0;
76
+ left: 0;
33
77
  }
34
78
 
35
- .tna-card__action {
79
+ .tna-card__image {
80
+ width: 100%;
81
+ height: 100%;
82
+ object-fit: cover;
36
83
  }
37
84
  }
@@ -1,16 +1,15 @@
1
1
  import Card from "./template.njk";
2
- import "../../all.scss";
3
- import "./_card.scss";
2
+ import "./_index.scss";
4
3
  import macroOptions from "./macro-options.json";
5
4
 
6
5
  const argTypes = {
7
- supertitle: { control: "text" },
8
- title: { control: "text" },
6
+ heading: { control: "object" },
9
7
  href: { control: "text" },
10
8
  image: { control: "object" },
11
9
  body: { control: "text" },
12
10
  text: { control: "text" },
13
11
  actions: { control: "object" },
12
+ featured: { control: "boolean" },
14
13
  htmlElement: { control: "text" },
15
14
  classes: { control: "text" },
16
15
  attributes: { control: "text" },
@@ -28,26 +27,26 @@ export default {
28
27
  };
29
28
 
30
29
  const Template = ({
31
- supertitle,
32
- title,
30
+ heading,
33
31
  href,
34
32
  image,
35
33
  body,
36
34
  text,
37
35
  actions,
36
+ featured,
38
37
  htmlElement,
39
38
  classes,
40
39
  attributes,
41
40
  }) => {
42
41
  return Card({
43
42
  params: {
44
- supertitle,
45
- title,
43
+ heading,
46
44
  href,
47
45
  image,
48
46
  body,
49
47
  text,
50
48
  actions,
49
+ featured,
51
50
  htmlElement,
52
51
  classes,
53
52
  attributes,
@@ -57,8 +56,39 @@ const Template = ({
57
56
 
58
57
  export const Standard = Template.bind({});
59
58
  Standard.args = {
60
- supertitle: "Card supertitle",
61
- title: "Card title",
59
+ heading: {
60
+ supertitle: "Card supertitle",
61
+ title: "Card title",
62
+ level: 3,
63
+ size: "m",
64
+ singleSentence: true,
65
+ },
66
+ href: "#",
67
+ image: {
68
+ src: "https://loremflickr.com/640/360",
69
+ alt: "A placeholder image",
70
+ },
71
+ body: "<p>Card body</p>",
72
+ actions: [
73
+ {
74
+ text: "Card action",
75
+ href: "#",
76
+ title: "Go and do the action",
77
+ },
78
+ ],
79
+ htmlElement: "article",
80
+ classes: "tna-card--demo",
81
+ };
82
+
83
+ export const Featured = Template.bind({});
84
+ Featured.args = {
85
+ heading: {
86
+ supertitle: "Card supertitle",
87
+ title: "Card title",
88
+ level: 3,
89
+ size: "m",
90
+ singleSentence: true,
91
+ },
62
92
  href: "#",
63
93
  image: {
64
94
  src: "https://loremflickr.com/640/360",
@@ -72,6 +102,7 @@ Standard.args = {
72
102
  title: "Go and do the action",
73
103
  },
74
104
  ],
105
+ featured: true,
75
106
  htmlElement: "article",
76
107
  classes: "tna-card--demo",
77
108
  };