@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
@@ -1,84 +1,159 @@
1
1
  @use "sass:math";
2
+ @use "../../variables/grid";
3
+ @use "../../variables/media";
4
+ @use "../../tools/grid" as tools;
5
+
6
+ .tna-container {
7
+ max-width: grid.$largest-container-width;
8
+ width: 100%;
9
+ margin-right: auto;
10
+ margin-left: auto;
11
+ padding-right: math.div(grid.$gutter-width, 2);
12
+ padding-left: math.div(grid.$gutter-width, 2);
13
+
14
+ box-sizing: border-box;
15
+
16
+ display: -ms-flexbox;
17
+ display: flex;
18
+ flex-wrap: wrap;
19
+ justify-content: stretch;
20
+ align-items: stretch;
21
+
22
+ &.tna-container--max {
23
+ max-width: none;
24
+ }
2
25
 
3
- @import "../../variables/all";
4
- @import "../../utilities/grid";
26
+ &.tna-container--no-padding {
27
+ max-width: grid.$largest-container-width - (grid.$gutter-width * 2);
28
+ padding-right: 0;
29
+ padding-left: 0;
5
30
 
6
- @include nationalarchives-exports("nationalarchives/utilities/grid") {
7
- .tna-container {
8
- max-width: $largest-container-width;
9
- width: 100%;
10
- margin-right: auto;
11
- margin-left: auto;
12
- padding-right: math.div($gutter-width, 2);
13
- padding-left: math.div($gutter-width, 2);
31
+ .tna-column {
32
+ padding-right: 0;
33
+ padding-left: 0;
34
+ }
35
+ }
36
+ }
14
37
 
15
- box-sizing: border-box;
38
+ .tna-column {
39
+ padding-right: math.div(grid.$gutter-width, 2);
40
+ padding-left: math.div(grid.$gutter-width, 2);
16
41
 
17
- display: -ms-flexbox;
18
- display: flex;
19
- flex-wrap: wrap;
20
- justify-content: stretch;
21
- align-items: stretch;
42
+ box-sizing: border-box;
22
43
 
23
- &.tna-container--max {
24
- max-width: none;
25
- }
44
+ &.tna-column--full {
45
+ width: 100%;
46
+ }
26
47
 
27
- &.tna-container--no-padding {
28
- max-width: $largest-container-width - ($gutter-width * 2);
29
- padding-right: 0;
30
- padding-left: 0;
48
+ // &.column--no-padding {
49
+ // padding-right: 0;
50
+ // padding-left: 0;
51
+ // }
52
+ }
31
53
 
32
- .tna-column {
33
- padding-right: 0;
34
- padding-left: 0;
35
- }
36
- }
54
+ @for $i from 1 through 3 {
55
+ .tna-column--flex-#{$i} {
56
+ flex: $i 0;
37
57
  }
58
+ }
38
59
 
39
- .tna-column {
40
- padding-right: math.div($gutter-width, 2);
41
- padding-left: math.div($gutter-width, 2);
42
-
43
- box-sizing: border-box;
60
+ // @for $i from 1 through 3 {
61
+ // .column--order-#{$i} {
62
+ // order: $i;
63
+ // }
64
+ // }
44
65
 
45
- &.tna-column--full {
46
- width: 100%;
47
- }
66
+ @include tools.columns-generator(grid.$column-count);
48
67
 
49
- // &.column--no-padding {
50
- // padding-right: 0;
51
- // padding-left: 0;
52
- // }
68
+ @media #{media.$media-medium} {
69
+ .tna-column--full-medium {
70
+ width: 100%;
71
+ flex: none;
53
72
  }
54
73
 
55
74
  @for $i from 1 through 3 {
56
- .tna-column--flex-#{$i} {
75
+ .tna-column--flex-#{$i}-medium {
57
76
  flex: $i 0;
58
77
  }
59
78
  }
60
79
 
80
+ // @for $i from 1 through 3 {
81
+ // .column--order-#{$i}-medium {
82
+ // order: $i;
83
+ // }
84
+ // }
85
+
86
+ @include tools.columns-generator(grid.$column-count-medium, "-medium");
87
+ }
88
+
89
+ @media #{media.$media-mobile} {
90
+ .tna-container {
91
+ padding-right: math.div(grid.$gutter-width-mobile, 2) + 0.75rem;
92
+ padding-left: math.div(grid.$gutter-width-mobile, 2) + 0.75rem;
93
+ }
94
+
95
+ .tna-column {
96
+ padding-right: math.div(grid.$gutter-width-mobile, 2);
97
+ padding-left: math.div(grid.$gutter-width-mobile, 2);
98
+ }
99
+
100
+ // .column--width-full-mobile {
101
+ // width: 100%;
102
+ // }
103
+
104
+ // @for $i from 1 through 3 {
105
+ // .column--flex-#{$i}-mobile {
106
+ // flex: $i 0;
107
+ // }
108
+ // }
109
+
61
110
  // @for $i from 1 through 3 {
62
- // .column--order-#{$i} {
111
+ // .column--order-#{$i}-mobile {
63
112
  // order: $i;
64
113
  // }
65
114
  // }
115
+ }
66
116
 
67
- @include columns-generator($column-count);
68
-
69
- @media #{$media-medium} {
70
- @include grid-medium;
117
+ @media #{media.$media-small} {
118
+ .tna-column--full-small {
119
+ width: 100%;
120
+ flex: none;
71
121
  }
72
122
 
73
- @media #{$media-mobile} {
74
- @include grid-mobile;
123
+ @for $i from 1 through 3 {
124
+ .tna-column--flex-#{$i}-small {
125
+ flex: $i 0;
126
+ }
75
127
  }
76
128
 
77
- @media #{$media-small} {
78
- @include grid-small;
129
+ // @for $i from 1 through 3 {
130
+ // .column--order-#{$i}-small {
131
+ // order: $i;
132
+ // }
133
+ // }
134
+
135
+ @include tools.columns-generator(grid.$column-count-small, "-small");
136
+ }
137
+
138
+ @media #{media.$media-tiny} {
139
+ .tna-column--full-tiny {
140
+ width: 100%;
141
+ flex: none;
79
142
  }
80
143
 
81
- @media #{$media-tiny} {
82
- @include grid-tiny;
144
+ @for $i from 1 through 3 {
145
+ .tna-column--flex-#{$i}-tiny {
146
+ width: auto;
147
+
148
+ flex: $i 0;
149
+ }
83
150
  }
151
+
152
+ // @for $i from 1 through 3 {
153
+ // .column--order-#{$i}-tiny {
154
+ // order: $i;
155
+ // }
156
+ // }
157
+
158
+ @include tools.columns-generator(grid.$column-count-tiny, "-tiny");
84
159
  }
@@ -1,6 +1,5 @@
1
1
  import Header from "./template.njk";
2
- import "../../all.scss";
3
- import "./_grid.scss";
2
+ import "./_index.scss";
4
3
  import macroOptions from "./macro-options.json";
5
4
 
6
5
  const argTypes = {
@@ -19,7 +18,7 @@ Object.keys(argTypes).forEach((argType) => {
19
18
  });
20
19
 
21
20
  export default {
22
- title: "Utilities/Grid",
21
+ title: "Components/Grid",
23
22
  argTypes,
24
23
  };
25
24
 
@@ -1,84 +1,81 @@
1
- @include nationalarchives-exports(
2
- "nationalarchives/components/sensitive-image"
3
- ) {
4
- .tna-sensitive-image {
5
- }
1
+ @use "../../tools/typography" as typographyTools;
6
2
 
7
- .tna-sensitive-image__warning {
8
- }
3
+ .tna-sensitive-image {
4
+ }
9
5
 
10
- .tna-sensitive-image__details {
11
- position: relative;
6
+ .tna-sensitive-image__warning {
7
+ }
12
8
 
13
- // overflow: hidden;
9
+ .tna-sensitive-image__details {
10
+ position: relative;
14
11
 
15
- &::after {
16
- width: 100%;
17
- padding-bottom: calc(
18
- 100% * var(--sensitive-image-height) / var(--sensitive-image-width)
19
- );
12
+ // overflow: hidden;
20
13
 
21
- display: block;
14
+ &::after {
15
+ width: 100%;
16
+ padding-bottom: calc(
17
+ 100% * var(--sensitive-image-height) / var(--sensitive-image-width)
18
+ );
22
19
 
23
- position: relative;
24
- z-index: -1;
20
+ display: block;
25
21
 
26
- background-image: var(--sensitive-image);
27
- background-clip: padding-box;
28
- background-size: contain;
22
+ position: relative;
23
+ z-index: -1;
29
24
 
30
- filter: blur(15px) saturate(0);
25
+ background-image: var(--sensitive-image);
26
+ background-clip: padding-box;
27
+ background-size: contain;
31
28
 
32
- content: "";
33
- }
29
+ filter: blur(20px) saturate(0);
30
+
31
+ content: "";
34
32
  }
33
+ }
35
34
 
36
- .tna-sensitive-image__show {
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
35
+ .tna-sensitive-image__show {
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
40
39
 
41
- position: absolute;
42
- top: 0;
43
- right: 0;
44
- bottom: 0;
45
- left: 0;
46
- z-index: 1;
40
+ position: absolute;
41
+ top: 0;
42
+ right: 0;
43
+ bottom: 0;
44
+ left: 0;
45
+ z-index: 1;
47
46
 
48
- font-size: 0;
47
+ font-size: 0;
49
48
 
50
- cursor: pointer;
49
+ cursor: pointer;
51
50
 
52
- &::after {
53
- padding: 0.5rem 2rem;
51
+ &::after {
52
+ padding: 0.5rem 2rem;
54
53
 
55
- font-size: 1rem;
54
+ @include typographyTools.relativeFontSize(16);
55
+ background-color: #ff0;
56
56
 
57
- background-color: #ff0;
58
-
59
- content: attr(data-action);
60
- }
57
+ content: attr(data-action);
58
+ }
61
59
 
62
- &:hover {
63
- &::after {
64
- color: #fff;
60
+ &:hover {
61
+ &::after {
62
+ color: #fff;
65
63
 
66
- background-color: #000;
67
- }
64
+ background-color: #000;
68
65
  }
69
66
  }
67
+ }
70
68
 
71
- .tna-sensitive-image__container {
72
- }
69
+ .tna-sensitive-image__container {
70
+ }
73
71
 
74
- .tna-sensitive-image__image {
75
- width: 100%;
76
- }
72
+ .tna-sensitive-image__image {
73
+ width: 100%;
74
+ }
77
75
 
78
- .tna-sensitive-image__details[open] {
79
- &::after,
80
- .tna-sensitive-image__show {
81
- display: none;
82
- }
76
+ .tna-sensitive-image__details[open] {
77
+ &::after,
78
+ .tna-sensitive-image__show {
79
+ display: none;
83
80
  }
84
81
  }
@@ -1,6 +1,5 @@
1
1
  import SensitiveImage from "./template.njk";
2
- import "../../all.scss";
3
- import "./_sensitive-image.scss";
2
+ import "./_index.scss";
4
3
  import macroOptions from "./macro-options.json";
5
4
 
6
5
  const argTypes = {
@@ -0,0 +1,25 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Design/Prototyping" />
4
+
5
+ # Prototyping with the styles
6
+
7
+ The National Archives frontend styles include support for the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk/).
8
+
9
+ You can use the components and styles within the prototype kit to make rich HTML prototypes.
10
+
11
+ ## Create a new prototype
12
+
13
+ 1. Create an empty directory `mkdir my-new-prototype`
14
+ 1. Use `npx govuk-prototype-kit create` to create a new prototype project
15
+ 1. Install the frontend styles with `npm install @nationalarchives/frontend`
16
+ 1. Run `npm run dev` to start up the prototype kit
17
+ 1. Use the National Archives components!
18
+
19
+ ```Nunjucks
20
+ {% from "nationalarchives/components/button/macro.njk" import tnaButton %}
21
+ {{ tnaButton({
22
+ text: "I am a button",
23
+ url: "#"
24
+ }) }}
25
+ ```
@@ -0,0 +1,62 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/About" />
4
+
5
+ # Project history
6
+
7
+ ## Needs
8
+
9
+ TNA needed a frontend toolkit that was:
10
+
11
+ - standardised - a single source of truth for all TNA that follows all our coding standards (currently non-existent)
12
+ - version controlled - as well as [semantically versioned](https://semver.org/) with a [changelog](https://keepachangelog.com/en/1.0.0/)
13
+ - 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)
14
+ - accessible - all components meet WCAG 2.1 AA standards
15
+ - progressively enhanced - all components should still be operable without JavaScript, CSS or both
16
+ - importable into projects (via a service such as [NPM](https://www.npmjs.com/search?q=nationalarchives)) - to make dependency management as simple as possible
17
+ - 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)
18
+ - testable - both from an internal perspective as well as providing scenarios and expected results for language implimentations to be able to validate against
19
+ - lean - minimal reliance on other languages and dependencies to ensure good extendability and speed of development and deployment
20
+ - automatically published - leveraging CI/CD, creating a new release version should be as simple as possible
21
+
22
+ It would have also been nice to have a toolkit that was:
23
+
24
+ - extendable - rather than providing a static snapshot of the toolkit, we should always be able to extend it for any given application
25
+ - 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))
26
+ - 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
27
+
28
+ ## Current solutions
29
+
30
+ There was 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 needed to create a more generic set of components that were suitable for every TNA service, ~~while still extending the GOV.UK components and styles~~ *[Edit: this was not implemented]* but with a more TNA-branded look and feel.
31
+
32
+ We also had [nationalarchives/tna-frontend-design-toolkit](https://github.com/nationalarchives/tna-frontend-design-toolkit) which aimed to provide similar functionality but wasn't as featureful as we needed and wasn'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).
33
+
34
+ ## Proposed solution
35
+
36
+ This repository should hold all the JavaScript and SCSS source files required for all the frontend styles along with tests and expected markup.
37
+
38
+ ### Output
39
+
40
+ The source files will be compiled down to a NodeJS package and deployed to [NPM](https://www.npmjs.com/). The package will contain:
41
+
42
+ - 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)
43
+ - An AMD/UMD/IIFE (TBD) ES5 JavaScript file which can be included with a normal `<script>` element
44
+ - A single CSS file containing all the styles which can be included with a normal `<style>` element
45
+ - 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))
46
+
47
+ ### Component resources
48
+
49
+ Each component in this repository should contain:
50
+
51
+ - Nunjucks template - only used to display the component within the examples page and aid development
52
+ - SCSS - which could either be imported as a standalone styles declaration or as part of the compiled output
53
+ - JavaScript (ESNext) - if there is any progressive enhancement required on the component
54
+ - Options/properties - a list of the configurable properties of the component and their types
55
+ - 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)
56
+
57
+ ### Technologies
58
+
59
+ - SCSS (used by GDS, is the de facto standard CSS preprocessor, already using in ETNA)
60
+ - Webpack - compilation of JavaScript and CSS (used by numerous TNA projects already)
61
+ - Babel - will allow us to use ESNext or possibly even TypeScript (although this could go against the lean requirement)
62
+ - Storybook - allow viewing and testing of components (we have already used this elsewhere in TNA)
@@ -0,0 +1,9 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/Dependencies" />
4
+
5
+ # Update Storybook dependencies
6
+
7
+ ```sh
8
+ npx sb upgrade
9
+ ```
@@ -0,0 +1,16 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ <Meta title="Development/Publishing" />
4
+
5
+ # Publishing a new version
6
+
7
+ 1. Update `version` in `package.json` using [SemVer](https://semver.org/)
8
+ 1. Update the CHANGELOG
9
+ 1. Run `nvm use` to ensure the correct Node version is used
10
+ 1. Run `npm install` to update the `package-lock.json`
11
+ 1. Merge all changes to `main` via a pull request
12
+ 1. Tag the version with `git tag v1.0.0` (ensure leading `v` and change version number as necessary)
13
+ 1. Push the new tag with `git push origin --tags`
14
+ 1. Create a [new release on GitHub](https://github.com/nationalarchives/tna-frontend/releases/new) using the tag you just created
15
+
16
+ Once a release is created, the [publish pipeline](https://github.com/nationalarchives/tna-frontend/blob/main/.github/workflows/npm-publish.yml) will be triggered.
@@ -0,0 +1,91 @@
1
+ # Relationship to other resources
2
+
3
+ ## System context
4
+
5
+ ```mermaid
6
+ C4Context
7
+ Person(dev, "Developer", "TNA developer")
8
+ System_Ext(github, "GitHub", "Repositories for source files")
9
+ System_Ext(npm, "NPMJS", "Hosts NodeJS packages")
10
+ System_Ext(pypi, "PyPi", "Hosts Python packages")
11
+ Container(app, "Application", "Example application")
12
+ System_Ext(pypi, "PyPi", "Hosts Python packages")
13
+
14
+ Rel(dev, github, "commits to", "git")
15
+ UpdateRelStyle(dev, github, $offsetX="-30", $offsetY="-30")
16
+ Rel(github, npm, "publishes to", "npm")
17
+ Rel(github, pypi, "publishes to", "pip")
18
+ Rel(app, npm, "consumes", "npm")
19
+ Rel(app, pypi, "consumes", "pip")
20
+
21
+ UpdateLayoutConfig($c4ShapeInRow="2")
22
+ ```
23
+
24
+ ## Component diagram
25
+
26
+ ```mermaid
27
+ C4Context
28
+ Person(dev, "Developer", "TNA developer")
29
+
30
+ %% Boundary(developer_machine, "Developer machine", "boundary") {
31
+ %% System(docker, "Docker")
32
+ %% }
33
+
34
+ Boundary(github, "GitHub", "boundary") {
35
+ Boundary(github_jinja, "Jinja templates", "repository") {
36
+ Container(github_jinja_source, "Jinja templates")
37
+ }
38
+
39
+ Boundary(github_frontend, "Frontend styles", "repository") {
40
+ Container(github_frontend_source, "Frontend styles", "git repository")
41
+ }
42
+
43
+ Boundary(github_application, "Application", "repository") {
44
+ Container(github_application_source, "Application source code")
45
+ Component(github_application_image, "Application docker image", "GitHub image registry")
46
+ }
47
+ }
48
+
49
+ Boundary(npm, "NPMJS", "boundary") {
50
+ Component(npm_package, "Frontend styles")
51
+ }
52
+
53
+ Enterprise_Boundary(aws, "TNA AWS", "boundary") {
54
+ Container(app, "Application")
55
+ }
56
+
57
+ Boundary(pypi, "PyPi", "boundary") {
58
+ Component(pypi_package, "Jinja templates")
59
+ }
60
+
61
+ Rel(dev, github_frontend_source, "commits to")
62
+ UpdateRelStyle(dev, github_frontend_source, $offsetX="-80", $offsetY="-80")
63
+ Rel(github_frontend_source, npm_package, "publishes", "GitHub action")
64
+ UpdateRelStyle(github_frontend_source, npm_package, $offsetX="-40", $offsetY="-40")
65
+
66
+ Rel(dev, github_jinja_source, "commits to")
67
+ UpdateRelStyle(dev, github_jinja_source, $offsetX="-15", $offsetY="-80")
68
+ Rel(github_jinja_source, github_frontend_source, "consumes")
69
+ UpdateRelStyle(github_jinja_source, github_frontend_source, $offsetX="-40", $offsetY="-15")
70
+ Rel(github_jinja_source, pypi_package, "publishes", "GitHub action")
71
+ UpdateRelStyle(github_jinja_source, pypi_package, $offsetX="-110", $offsetY="-310")
72
+
73
+ Rel(dev, github_application_source, "commits to")
74
+ UpdateRelStyle(dev, github_application_source, $offsetX="-105", $offsetY="-250")
75
+ Rel(github_application_source, github_application_image, "creates", "GitHub action")
76
+ UpdateRelStyle(github_application_source, github_application_image, $offsetX="-90", $offsetY="-20")
77
+
78
+ Rel(github_application_image, npm_package, "consumes", "GitHub action")
79
+ UpdateRelStyle(github_application_image, npm_package, $offsetX="-50", $offsetY="-10")
80
+ Rel(github_application_image, pypi_package, "consumes", "GitHub action")
81
+ UpdateRelStyle(github_application_image, pypi_package, $offsetX="-120", $offsetY="-10")
82
+
83
+ %% Rel(dev, docker, "uses")
84
+ %% Rel(docker, npm_package, "consumes")
85
+ %% Rel(docker, pypi_package, "consumes")
86
+
87
+ Rel(app, github_application_image, "consumes")
88
+ UpdateRelStyle(app, github_application_image, $offsetX="-70", $offsetY="-10")
89
+
90
+ UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
91
+ ```
@@ -1,7 +1,7 @@
1
- import { Meta, Primary, Controls, Story } from "@storybook/blocks";
1
+ import { Meta } from "@storybook/blocks";
2
2
 
3
3
  <Meta title="Development/Structure" />
4
4
 
5
- # Project Structure
5
+ # Project structure
6
6
 
7
7
  [Technical details]
@@ -0,0 +1,44 @@
1
+ const argTypes = {
2
+ supertitle: { control: "text" },
3
+ title: { control: "text" },
4
+ level: { control: "number", min: 1, max: 6, step: 1 },
5
+ size: { control: "radio", options: ["m", "l", "xl"] },
6
+ singleSentence: { control: "boolean" },
7
+ };
8
+
9
+ export default {
10
+ title: "Utilities/Typography",
11
+ argTypes,
12
+ };
13
+
14
+ const Template = ({
15
+ supertitle,
16
+ title,
17
+ level = 3,
18
+ size = "l",
19
+ singleSentence,
20
+ }) =>
21
+ singleSentence
22
+ ? `<hgroup class="tna-hgroup tna-hgroup--${size}">
23
+ <h${level} class="tna-hgroup__title">
24
+ <span class="tna-hgroup__supertitle">${supertitle}</span>
25
+ ${title}
26
+ </h${level}>
27
+ </hgroup>`
28
+ : `<hgroup class="tna-hgroup tna-hgroup--${size}">
29
+ <p class="tna-hgroup__supertitle">${supertitle}</p>
30
+ <h${level} class="tna-hgroup__title">${title}</h${level}>
31
+ </hgroup>`;
32
+
33
+ export const HeadingGroup = Template.bind({});
34
+ HeadingGroup.args = {
35
+ supertitle: "The story of",
36
+ title: "Alice Hawkins",
37
+ singleSentence: true,
38
+ };
39
+
40
+ export const HeadingGroupSeparated = Template.bind({});
41
+ HeadingGroupSeparated.args = {
42
+ supertitle: "Record revealed",
43
+ title: "The Monteagle Letter",
44
+ };
@@ -4,7 +4,7 @@ const argTypes = {
4
4
  };
5
5
 
6
6
  export default {
7
- title: "Global styles/Typography",
7
+ title: "Utilities/Typography",
8
8
  argTypes,
9
9
  };
10
10