@nationalarchives/frontend 0.1.10-prerelease → 0.1.12-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 (115) hide show
  1. package/README.md +1 -1
  2. package/govuk-prototype-kit.config.json +0 -3
  3. package/nationalarchives/_features.scss +3 -0
  4. package/nationalarchives/all.css +1 -1
  5. package/nationalarchives/all.css.map +1 -1
  6. package/nationalarchives/all.js +1 -1
  7. package/nationalarchives/all.js.map +1 -1
  8. package/nationalarchives/all.mjs +24 -8
  9. package/nationalarchives/all.scss +8 -4
  10. package/nationalarchives/assets/images/tna-square-logo.svg +5 -24
  11. package/nationalarchives/components/_index.scss +13 -0
  12. package/nationalarchives/components/breadcrumbs/_index.scss +28 -7
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -1
  14. package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
  15. package/nationalarchives/components/breadcrumbs/macro.njk +1 -1
  16. package/nationalarchives/components/breadcrumbs/template.njk +14 -13
  17. package/nationalarchives/components/button/_index.scss +23 -11
  18. package/nationalarchives/components/button/button.stories.js +1 -1
  19. package/nationalarchives/components/button/fixtures.json +5 -5
  20. package/nationalarchives/components/button/macro.njk +1 -1
  21. package/nationalarchives/components/card/_index.scss +51 -7
  22. package/nationalarchives/components/card/card.js +2 -0
  23. package/nationalarchives/components/card/card.js.map +1 -0
  24. package/nationalarchives/components/card/card.mjs +45 -0
  25. package/nationalarchives/components/card/card.stories.js +18 -14
  26. package/nationalarchives/components/card/fixtures.json +14 -12
  27. package/nationalarchives/components/card/macro-options.json +18 -0
  28. package/nationalarchives/components/card/macro.njk +1 -1
  29. package/nationalarchives/components/card/template.njk +9 -4
  30. package/nationalarchives/components/filters/filters.stories.js +1 -1
  31. package/nationalarchives/components/filters/macro.njk +1 -1
  32. package/nationalarchives/components/filters/template.njk +2 -2
  33. package/nationalarchives/components/footer/_index.scss +24 -12
  34. package/nationalarchives/components/footer/fixtures.json +1 -1
  35. package/nationalarchives/components/footer/footer.stories.js +7 -7
  36. package/nationalarchives/components/footer/macro.njk +1 -1
  37. package/nationalarchives/components/footer/template.njk +4 -4
  38. package/nationalarchives/components/grid/_index.scss +10 -12
  39. package/nationalarchives/components/grid/fixtures.json +12 -12
  40. package/nationalarchives/components/grid/grid.stories.js +55 -1
  41. package/nationalarchives/components/grid/macro-options.json +30 -0
  42. package/nationalarchives/components/grid/macro.njk +1 -1
  43. package/nationalarchives/components/grid/template.njk +17 -1
  44. package/nationalarchives/components/header/_index.scss +103 -38
  45. package/nationalarchives/components/header/header.js +1 -1
  46. package/nationalarchives/components/header/header.js.map +1 -1
  47. package/nationalarchives/components/header/header.mjs +1 -12
  48. package/nationalarchives/components/header/header.stories.js +143 -2
  49. package/nationalarchives/components/header/macro-options.json +26 -0
  50. package/nationalarchives/components/header/macro.njk +1 -1
  51. package/nationalarchives/components/header/template.njk +27 -30
  52. package/nationalarchives/components/hero/_index.scss +33 -6
  53. package/nationalarchives/components/hero/fixtures.json +16 -1
  54. package/nationalarchives/components/hero/hero.stories.js +17 -3
  55. package/nationalarchives/components/hero/macro-options.json +13 -1
  56. package/nationalarchives/components/hero/macro.njk +1 -1
  57. package/nationalarchives/components/hero/template.njk +7 -5
  58. package/nationalarchives/components/phase-banner/_index.scss +17 -0
  59. package/nationalarchives/components/phase-banner/fixtures.json +69 -2
  60. package/nationalarchives/components/phase-banner/macro.njk +1 -1
  61. package/nationalarchives/components/phase-banner/phase-banner.stories.js +32 -6
  62. package/nationalarchives/components/phase-banner/template.njk +4 -4
  63. package/nationalarchives/components/picture/_index.scss +77 -0
  64. package/nationalarchives/components/picture/fixtures.json +4 -0
  65. package/nationalarchives/components/picture/macro-options.json +88 -0
  66. package/nationalarchives/components/picture/macro.njk +3 -0
  67. package/nationalarchives/components/picture/picture.js +2 -0
  68. package/nationalarchives/components/picture/picture.js.map +1 -0
  69. package/nationalarchives/components/picture/picture.mjs +57 -0
  70. package/nationalarchives/components/picture/picture.stories.js +63 -0
  71. package/nationalarchives/components/picture/template.njk +42 -0
  72. package/nationalarchives/components/profile/_index.scss +2 -0
  73. package/nationalarchives/components/profile/fixtures.json +4 -0
  74. package/nationalarchives/components/profile/macro-options.json +14 -0
  75. package/nationalarchives/components/profile/macro.njk +3 -0
  76. package/nationalarchives/components/profile/profile.stories.js +32 -0
  77. package/nationalarchives/components/profile/template.njk +15 -0
  78. package/nationalarchives/components/sensitive-image/fixtures.json +3 -3
  79. package/nationalarchives/components/sensitive-image/macro.njk +1 -1
  80. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -1
  81. package/nationalarchives/components/tabs/_index.scss +148 -0
  82. package/nationalarchives/components/tabs/fixtures.json +4 -0
  83. package/nationalarchives/components/tabs/macro-options.json +52 -0
  84. package/nationalarchives/components/tabs/macro.njk +3 -0
  85. package/nationalarchives/components/tabs/tabs.js +2 -0
  86. package/nationalarchives/components/tabs/tabs.js.map +1 -0
  87. package/nationalarchives/components/tabs/tabs.mjs +214 -0
  88. package/nationalarchives/components/tabs/tabs.stories.js +302 -0
  89. package/nationalarchives/components/tabs/template.njk +20 -0
  90. package/nationalarchives/patterns/_index.scss +1 -0
  91. package/nationalarchives/patterns/featured-collection/_index.scss +13 -0
  92. package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +35 -0
  93. package/nationalarchives/patterns/featured-collection/macro-options.json +20 -0
  94. package/nationalarchives/patterns/featured-collection/macro.njk +3 -0
  95. package/nationalarchives/patterns/featured-collection/template.njk +96 -0
  96. package/nationalarchives/stories/development/contributing.mdx +2 -1
  97. package/nationalarchives/stories/utilities/colour.stories.js +189 -0
  98. package/nationalarchives/stories/utilities/typography.mdx +1 -0
  99. package/nationalarchives/stories/utilities/typography.stories.js +15 -0
  100. package/nationalarchives/templates/layouts/_generic.njk +1 -1
  101. package/nationalarchives/tools/_colour.scss +129 -0
  102. package/nationalarchives/tools/_grid.scss +2 -2
  103. package/nationalarchives/tools/_index.scss +5 -0
  104. package/nationalarchives/tools/_typography.scss +15 -0
  105. package/nationalarchives/utilities/_debug.scss +11 -0
  106. package/nationalarchives/utilities/_global.scss +65 -41
  107. package/nationalarchives/utilities/_index.scss +3 -0
  108. package/nationalarchives/utilities/_typography.scss +92 -60
  109. package/nationalarchives/variables/_colour.scss +98 -71
  110. package/nationalarchives/variables/_typography.scss +1 -1
  111. package/package.json +24 -23
  112. package/nationalarchives/components/_all.scss +0 -10
  113. package/nationalarchives/tools/_all.scss +0 -4
  114. package/nationalarchives/utilities/_all.scss +0 -2
  115. /package/nationalarchives/variables/{_all.scss → _index.scss} +0 -0
@@ -1,8 +1,8 @@
1
- {%- set classes = [params.classes] if params.classes else [] -%}
1
+ {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
2
  {%- if params.colour -%}
3
- {%- set classes = classes.concat('tna-header--' + params.colour) -%}
3
+ {%- set containerClasses = containerClasses.concat('tna-header--' + params.colour) -%}
4
4
  {%- endif -%}
5
- <header class="tna-header {{ classes | join(' ') }}" data-module="tna-header" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
5
+ <header class="tna-header {{ containerClasses | join(' ') }}" data-module="tna-header" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
6
6
  {%- if params.exit -%}
7
7
  <div class="tna-header__exit">
8
8
  <div class="tna-container">
@@ -19,30 +19,12 @@
19
19
  {%- endif -%}
20
20
  <div class="tna-container tna-header__contents">
21
21
  <div class="tna-column tna-header__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">
24
- <rect class="tna-logo__background" fill="none" width="160" height="160"/>
22
+ <{%- if params.logo.href -%}a href="{{ params.logo.href }}" class="tna-header__logo-link tna-header__logo-link--href" title="{%- if params.logo.title -%}{{ params.logo.title }}{%- else -%}The National Archives{%- if params.logo.strapline %} - {{ params.logo.strapline }}{%- endif -%}{%- endif -%}"{%- else -%}span class="tna-header__logo-link"{%- endif -%}>
23
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" class="tna-logo" style="enable-background:new 0 0 160 160" viewBox="0 0 160 160" width="100" height="100">
24
+ <path fill="#fff" d="M0 0h160v160H0z" class="tna-logo__background"/>
25
25
  <g class="tna-logo__foreground" fill="#000">
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"/>
27
- <polygon points="21.3,19.5 15.9,19.5 15.9,16.5 30.2,16.5 30.2,19.5 24.8,19.5 24.8,37.9 21.3,37.9 "/>
28
- <polygon points="31.6,16.5 35,16.5 35,25.5 43.4,25.5 43.4,16.5 46.8,16.5 46.8,37.9 43.4,37.9 43.4,28.6 35,28.6 35,37.9 31.6,37.9 "/>
29
- <polygon points="50.9,16.5 63.1,16.5 63.1,19.5 54.3,19.5 54.3,25.6 61.7,25.6 61.7,28.6 54.3,28.6 54.3,34.9 63.1,34.9 63.1,37.9 50.9,37.9 "/>
30
- <path d="M19.7,69.2h3.8l6.4,12.5c0.6,1.1,1.1,2.7,1.6,4h0.2c-0.2-1.7-0.3-3.6-0.3-4.8V69.2h3.5v21.4h-3.7l-6.3-12.3c-0.7-1.4-1.2-2.7-1.7-4.2h-0.2c0.2,1.4,0.3,3.3,0.3,5v11.5h-3.5C19.7,90.6,19.7,69.2,19.7,69.2z"/>
31
- <path d="M47.8,82.6l-1.7-6.3c-0.3-1.1-0.6-2.2-0.9-3.8H45c-0.3,1.6-0.5,2.6-0.8,3.8l-1.7,6.3H47.8z M43,69.2h4.2l6.2,21.4h-3.5l-1.5-5.2h-6.6l-1.4,5.2h-3.6L43,69.2z"/>
32
- <polygon points="57.2,72.3 51.8,72.3 51.8,69.2 66,69.2 66,72.3 60.6,72.3 60.6,90.7 57.2,90.7 "/>
33
- <rect x="67.8" y="69.2" width="3.5" height="21.4"/>
34
- <path d="M87.5,80c0-5.3-1.7-8-4.8-8c-3.2,0-4.8,2.7-4.8,8c0,5.2,1.6,7.9,4.8,7.9C85.9,87.9,87.5,85.2,87.5,80 M74.2,80c0-7,3-11.1,8.5-11.1c5.4,0,8.4,4.1,8.4,11.1c0,6.9-3,11-8.4,11C77.3,91,74.2,86.9,74.2,80"/>
35
- <path d="M94.3,69.2H98l6.4,12.5c0.6,1.1,1.2,2.7,1.7,4h0.2c-0.2-1.7-0.3-3.6-0.3-4.8V69.2h3.4v21.4h-3.7l-6.3-12.3c-0.7-1.4-1.2-2.7-1.7-4.2h-0.2c0.2,1.4,0.3,3.3,0.3,5v11.5h-3.5V69.2z"/>
36
- <path d="M122.4,82.6l-1.7-6.3c-0.3-1.1-0.6-2.2-0.9-3.8h-0.2c-0.3,1.6-0.5,2.6-0.8,3.8l-1.7,6.3H122.4z M117.6,69.2h4.2l6.2,21.4h-3.5l-1.5-5.2h-6.6l-1.4,5.2h-3.6L117.6,69.2z"/>
37
- <polygon points="129.9,69.2 133.4,69.2 133.4,87.6 141.8,87.6 141.8,90.7 129.9,90.7 "/>
38
- <path d="M26.9,135.2l-1.7-6.3c-0.3-1.1-0.6-2.2-0.9-3.8h-0.2c-0.3,1.6-0.5,2.6-0.8,3.8l-1.7,6.3H26.9z M22.1,121.8h4.2l6.2,21.4H29l-1.5-5.2h-6.6l-1.4,5.2h-3.6L22.1,121.8z"/>
39
- <path d="M39.9,132.5c2.5,0,3.4-1.6,3.4-3.9c0-2.2-1-3.8-3.4-3.8h-2.7v7.7H39.9z M33.8,121.8h6.4c4.5,0,6.7,2.4,6.7,6.6c0,3.1-1.5,5.6-3.7,6.3v0.2c1,1.1,4,7.5,4.8,7.9v0.5h-3.8c-1-0.6-3.6-7.2-4.4-7.8h-2.5v7.8h-3.5L33.8,121.8L33.8,121.8z"/>
40
- <path d="M52.9,132.5c0,5.3,1.9,8,4.8,8c2.9,0,4-2,4-5.2l3.5,0.1c0,0.2,0.1,0.4,0.1,0.6c0,4.4-2.1,7.5-7.5,7.5c-5.2,0-8.5-3.9-8.5-11.1c0-7.1,3.3-11,8.5-11c6.4,0,7.5,4.6,7.5,7.2c0,0.3,0,0.7-0.1,0.9l-3.5,0.1c0-3.3-1.2-5.2-4-5.2C54.8,124.6,52.9,127.3,52.9,132.5"/>
41
- <polygon points="68,121.8 71.5,121.8 71.5,130.9 79.8,130.9 79.8,121.8 83.3,121.8 83.3,143.3 79.8,143.3 79.8,133.9 71.5,133.9 71.5,143.3 68,143.3 "/>
42
- <rect x="87.9" y="121.8" width="3.5" height="21.4"/>
43
- <path d="M94.2,121.8h3.6l3.2,12.3c0.5,1.9,0.8,3.6,1.1,5.6h0.2c0.3-2,0.6-3.7,1.1-5.6l3.2-12.3h3.6l-6.1,21.4h-4.1L94.2,121.8z"/>
44
- <polygon points="112.7,121.8 125,121.8 125,124.9 116.2,124.9 116.2,130.9 123.6,130.9 123.6,133.9 116.2,133.9 116.2,140.2 125,140.2 125,143.3 112.7,143.3 "/>
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.3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-3.4-1.3c-2.4-.9-4.2-2.4-4.2-5.7 0-3.5 2.3-6.1 6.6-6.1 5.5 0 6.4 3.6 6.4 5.9 0 .3 0 .7-.1 1.1l-3.4.1c0-.2.1-.5.1-.7 0-1.7-.6-3.2-3-3.2-2.1 0-3 1.2-3 2.8 0 1.7.9 2.5 2.2 2.9l3.5 1.3c2.6 1 4.3 2.6 4.3 5.8 0 3.6-2.4 6.1-7 6.1-5.9 0-6.8-3.9-6.8-6.5 0-.3 0-.6.1-1l3.3-.1z"/>
46
28
  </g>
47
29
  </svg>
48
30
  {%- if params.logo.strapline -%}
@@ -50,16 +32,31 @@
50
32
  {%- endif -%}
51
33
  </{%- if params.logo.href -%}a{%- else -%}span{%- endif -%}>
52
34
  </div>
53
- {%- if params.navigation -%}
35
+ {%- if params.navigation or params.topNavigation -%}
54
36
  <div class="tna-column tna-column--flex-1- tna-header__navigation-toggle"><!-- POPULATED BY JAVASCRIPT IF ENABLED --></div>
55
37
  <nav class="tna-column tna-column--flex-1 tna-column--full-small tna-column--full-tiny tna-header__navigation" aria-label="Main site navigation">
38
+ {%- if params.navigation -%}
56
39
  <ul class="tna-header__navigation-items">
57
- {%- for item in params.navigation -%}
40
+ {%- for item in params.navigation -%}
58
41
  <li class="tna-header__navigation-item">
59
- <a href="{{ item.href }}" class="tna-header__navigation-item-link{%- if item.selected %} tna-header__navigation-item-link--selected{% endif %}" tabindex="0" {%- if item.selected %} aria-current="true"{% endif %} {%- if item.title %} title="{{ item.title }}"{% endif %}>{{ item.text }}</a>
42
+ <a href="{{ item.href }}" class="tna-header__navigation-item-link{%- if item.selected %} tna-header__navigation-item-link--selected{% endif %}" tabindex="0" {%- if item.selected %} aria-current="true"{% endif %} {%- if item.title %} title="{{ item.title }}"{% endif %}>
43
+ {{ item.text }}
44
+ </a>
60
45
  </li>
61
- {%- endfor -%}
46
+ {%- endfor -%}
62
47
  </ul>
48
+ {%- endif -%}
49
+ {%- if params.topNavigation -%}
50
+ <ul class="tna-header__top-navigation-items">
51
+ {%- for item in params.topNavigation -%}
52
+ <li class="tna-header__top-navigation-item">
53
+ <a href="{{ item.href }}" class="tna-header__top-navigation-item-link" tabindex="0" {%- if item.title %} title="{{ item.title }}"{% endif %}>
54
+ {{ item.text }}
55
+ </a>
56
+ </li>
57
+ {%- endfor -%}
58
+ </ul>
59
+ {%- endif -%}
63
60
  </nav>
64
61
  {%- endif -%}
65
62
  </div>
@@ -1,3 +1,5 @@
1
+ @use "../../utilities/global"; // To get %tna-invert
2
+ @use "../../tools/colour";
1
3
  @use "../../tools/media";
2
4
 
3
5
  .tna-hero {
@@ -5,14 +7,11 @@
5
7
  padding-top: 5.25rem;
6
8
  padding-bottom: 3.25rem;
7
9
 
8
- display: -ms-flexbox;
9
10
  display: flex;
10
11
  align-items: flex-end;
11
12
 
12
13
  position: relative;
13
14
 
14
- background-color: #26262a; // Variable
15
-
16
15
  &__image {
17
16
  width: 100%;
18
17
  height: 100%;
@@ -36,6 +35,8 @@
36
35
  right: 1.25rem;
37
36
  bottom: 1.25rem;
38
37
  z-index: 3;
38
+
39
+ @include colour.colour-font("font-base");
39
40
  }
40
41
 
41
42
  &__image-details-summary {
@@ -88,7 +89,7 @@
88
89
  &__content-inner {
89
90
  padding: 2.5rem 1.5rem;
90
91
 
91
- background-color: #fff;
92
+ @include colour.colour-background("page-background");
92
93
  }
93
94
 
94
95
  &__heading {
@@ -104,6 +105,9 @@
104
105
 
105
106
  display: block;
106
107
 
108
+ @include colour.invert;
109
+ // @extend %tna-invert;
110
+
107
111
  &__image {
108
112
  height: 320px;
109
113
 
@@ -133,9 +137,9 @@
133
137
  }
134
138
 
135
139
  &__content-inner {
136
- color: #fff;
140
+ padding: 1.5rem 0;
137
141
 
138
- background-color: inherit;
142
+ background-color: transparent;
139
143
  }
140
144
 
141
145
  &__heading {
@@ -143,6 +147,8 @@
143
147
  }
144
148
 
145
149
  &__body {
150
+ margin-top: 1rem;
151
+
146
152
  color: inherit;
147
153
  }
148
154
  }
@@ -152,4 +158,25 @@
152
158
  height: 240px;
153
159
  }
154
160
  }
161
+
162
+ @mixin high-contrast {
163
+ &__content-inner {
164
+ border: 1px transparent solid;
165
+ @include colour.colour-border("keyline-dark");
166
+
167
+ @include media.on-mobile {
168
+ border: none;
169
+ }
170
+ }
171
+ }
172
+
173
+ .tna-template--high-contrast-theme & {
174
+ @include high-contrast;
175
+ }
176
+
177
+ @media (prefers-contrast: more) {
178
+ .tna-template--system-theme & {
179
+ @include high-contrast;
180
+ }
181
+ }
155
182
  }
@@ -1,4 +1,19 @@
1
1
  {
2
2
  "component": "hero",
3
- "fixtures": []
3
+ "fixtures": [
4
+ {
5
+ "name": "minimal",
6
+ "options": {
7
+ "heading": "Title",
8
+ "image": {
9
+ "src": "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
10
+ "alt": "The National Archives office",
11
+ "width": 1996,
12
+ "height": 1331
13
+ }
14
+ },
15
+ "html": "<header class=\"tna-hero \"><img src=\"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg\" alt=\"The National Archives office\" class=\"tna-hero__image\" width=\"1996\" height=\"1331\"><div class=\"tna-container tna-hero__inner\"><div class=\"tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny tna-hero__content\"><div class=\"tna-hero__content-inner\"><h1 class=\"tna-heading tna-heading--xl tna-hero__heading\">Title</h1></div></div></div></header>",
16
+ "hidden": false
17
+ }
18
+ ]
4
19
  }
@@ -41,9 +41,11 @@ Standard.args = {
41
41
  heading: "Title",
42
42
  body: "<p>Body</p>",
43
43
  image: {
44
- src: "https://picsum.photos/id/29/640/360",
45
- alt: "A placeholder image",
46
- information: "Photo of some mountains by a famous photographer, ©2012",
44
+ src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
45
+ alt: "The National Archives office",
46
+ width: 1996,
47
+ height: 1331,
48
+ information: "An interesting photo by a famous photographer ©2023",
47
49
  },
48
50
  classes: "tna-hero--demo",
49
51
  };
@@ -74,3 +76,15 @@ Standard.play = async ({ args, canvasElement, step }) => {
74
76
  await expect(information).not.toBeVisible();
75
77
  });
76
78
  };
79
+
80
+ export const TitleOnly = Template.bind({});
81
+ TitleOnly.args = {
82
+ heading: "Title",
83
+ image: {
84
+ src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
85
+ alt: "The National Archives office",
86
+ width: 1996,
87
+ height: 1331,
88
+ },
89
+ classes: "tna-hero--demo",
90
+ };
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "name": "image",
22
22
  "type": "object",
23
- "required": false,
23
+ "required": true,
24
24
  "description": "",
25
25
  "params": [
26
26
  {
@@ -35,6 +35,18 @@
35
35
  "required": true,
36
36
  "description": ""
37
37
  },
38
+ {
39
+ "name": "width",
40
+ "type": "number",
41
+ "required": true,
42
+ "description": ""
43
+ },
44
+ {
45
+ "name": "height",
46
+ "type": "number",
47
+ "required": true,
48
+ "description": ""
49
+ },
38
50
  {
39
51
  "name": "information",
40
52
  "type": "string",
@@ -1,3 +1,3 @@
1
1
  {% macro tnaHero(params) %}
2
- {%- include "./template.njk" -%}
2
+ {%- include "nationalarchives/components/hero/template.njk" -%}
3
3
  {% endmacro %}
@@ -1,6 +1,6 @@
1
- {%- set classes = [params.classes] if params.classes else [] -%}
2
- <header class="tna-hero {{ classes | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
- <img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-hero__image">
1
+ {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
+ <header class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
+ <img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-hero__image" width="{{ params.image.width }}" height="{{ params.image.height }}">
4
4
  {%- if params.image.information -%}
5
5
  <details class="tna-hero__image-details">
6
6
  <summary class="tna-hero__image-details-summary">
@@ -19,13 +19,15 @@
19
19
  {{ params.heading }}
20
20
  </h1>
21
21
  {%- endif -%}
22
- <div class="tna-hero__body">
23
22
  {%- if params.text -%}
23
+ <div class="tna-hero__body">
24
24
  <p>{{ params.text }}</p>
25
+ </div>
25
26
  {%- elseif params.body -%}
27
+ <div class="tna-hero__body">
26
28
  {{ params.body | safe }}
27
- {%- endif -%}
28
29
  </div>
30
+ {%- endif -%}
29
31
  </div>
30
32
  </div>
31
33
  </div>
@@ -1,10 +1,15 @@
1
+ @use "../../tools/colour";
1
2
  @use "../../tools/media";
2
3
  @use "../../tools/typography";
3
4
 
4
5
  .tna-phase-banner {
6
+ @include colour.fixed;
7
+
5
8
  padding-top: 0.375rem;
6
9
  padding-bottom: 0.375rem;
7
10
 
11
+ background-color: #d9d9d6;
12
+
8
13
  .tna-container {
9
14
  align-items: center;
10
15
  flex-wrap: nowrap;
@@ -37,7 +42,19 @@
37
42
  }
38
43
  }
39
44
 
45
+ &--discovery {
46
+ background-color: #fad3d4;
47
+ }
48
+
49
+ &--alpha {
50
+ background-color: #f9e1bc;
51
+ }
52
+
40
53
  &--beta {
41
54
  background-color: #f9f7e2;
42
55
  }
56
+
57
+ &--live {
58
+ background-color: #dde5d5;
59
+ }
43
60
  }
@@ -1,13 +1,80 @@
1
1
  {
2
2
  "component": "phase-banner",
3
3
  "fixtures": [
4
+ {
5
+ "name": "discovery",
6
+ "options": {
7
+ "phase": "discovery",
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--discovery\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Discovery</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
11
+ "hidden": false
12
+ },
13
+ {
14
+ "name": "alpha",
15
+ "options": {
16
+ "phase": "alpha",
17
+ "message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
18
+ },
19
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--alpha\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Alpha</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
20
+ "hidden": false
21
+ },
4
22
  {
5
23
  "name": "beta",
6
24
  "options": {
7
- "phase": "Beta",
25
+ "phase": "beta",
26
+ "message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
27
+ },
28
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--beta\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Beta</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
29
+ "hidden": false
30
+ },
31
+ {
32
+ "name": "live",
33
+ "options": {
34
+ "phase": "live",
8
35
  "message": "This is a new service – <a href='#'>give us your feedback</a> to help improve it."
9
36
  },
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>",
37
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--live\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">This is a new service – <a href='#'>give us your feedback</a> to help improve it.</p></div></div></div>",
38
+ "hidden": false
39
+ },
40
+ {
41
+ "name": "capital letters",
42
+ "options": {
43
+ "phase": "BETA",
44
+ "message": "Message"
45
+ },
46
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--beta\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Beta</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
47
+ "hidden": false
48
+ },
49
+ {
50
+ "name": "unknown phase",
51
+ "options": {
52
+ "phase": "unknown",
53
+ "message": "Message"
54
+ },
55
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--unknown\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Unknown</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
56
+ "hidden": false
57
+ },
58
+ {
59
+ "name": "with classes",
60
+ "options": {
61
+ "phase": "live",
62
+ "message": "Message",
63
+ "classes": "tna-phase-banner--fixture"
64
+ },
65
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--fixture tna-phase-banner--live\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
66
+ "hidden": false
67
+ },
68
+ {
69
+ "name": "with attributes",
70
+ "options": {
71
+ "phase": "live",
72
+ "message": "Message",
73
+ "attributes": {
74
+ "data-fixturetest": "pass"
75
+ }
76
+ },
77
+ "html": "<div class=\"tna-phase-banner tna-phase-banner--live\" data-fixturetest=\"pass\"><div class=\"tna-container\"><div class=\"tna-column\"><span class=\"tna-phase-banner__phase\">Live</span></div><div class=\"tna-column\"><p class=\"tna-phase-banner__message\">Message</p></div></div></div>",
11
78
  "hidden": false
12
79
  }
13
80
  ]
@@ -1,3 +1,3 @@
1
1
  {% macro tnaPhaseBanner(params) %}
2
- {%- include "./template.njk" -%}
2
+ {%- include "nationalarchives/components/phase-banner/template.njk" -%}
3
3
  {% endmacro %}
@@ -2,7 +2,10 @@ import PhaseBanner from "./template.njk";
2
2
  import macroOptions from "./macro-options.json";
3
3
 
4
4
  const argTypes = {
5
- phase: { control: "text" },
5
+ phase: {
6
+ control: "radio",
7
+ options: ["discovery", "alpha", "beta", "live"],
8
+ },
6
9
  message: { control: "text" },
7
10
  classes: { control: "text" },
8
11
  attributes: { control: "object" },
@@ -15,7 +18,7 @@ Object.keys(argTypes).forEach((argType) => {
15
18
  });
16
19
 
17
20
  export default {
18
- title: "Components/Phase banner",
21
+ title: "Work in progress/Components/Phase banner",
19
22
  argTypes,
20
23
  };
21
24
 
@@ -30,9 +33,32 @@ const Template = ({ phase, message, classes, attributes }) => {
30
33
  });
31
34
  };
32
35
 
33
- export const Standard = Template.bind({});
34
- Standard.args = {
35
- phase: "Beta",
36
+ export const Discovery = Template.bind({});
37
+ Discovery.args = {
38
+ phase: "discovery",
39
+ message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
40
+ };
41
+
42
+ export const Alpha = Template.bind({});
43
+ Alpha.args = {
44
+ phase: "alpha",
45
+ message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
46
+ };
47
+
48
+ export const Beta = Template.bind({});
49
+ Beta.args = {
50
+ phase: "beta",
51
+ message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
52
+ };
53
+
54
+ export const Live = Template.bind({});
55
+ Live.args = {
56
+ phase: "live",
57
+ message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
58
+ };
59
+
60
+ export const Unknown = Template.bind({});
61
+ Unknown.args = {
62
+ phase: "unknown",
36
63
  message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
37
- classes: "tna-phase-banner--demo",
38
64
  };
@@ -1,10 +1,10 @@
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 %}>
1
+ {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
+ {%- set containerClasses = containerClasses.concat('tna-phase-banner--' + params.phase | lower) -%}
3
+ <div class="tna-phase-banner {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
4
4
  <div class="tna-container">
5
5
  <div class="tna-column">
6
6
  <span class="tna-phase-banner__phase">
7
- {{ params.phase }}
7
+ {{ params.phase | capitalize }}
8
8
  </span>
9
9
  </div>
10
10
  <div class="tna-column">
@@ -0,0 +1,77 @@
1
+ @use "../../utilities/global"; // To get %tna-invert
2
+ @use "../../tools/colour";
3
+
4
+ .tna-picture {
5
+ margin: 0 0 1rem;
6
+ padding: 0;
7
+
8
+ &__image-wrapper {
9
+ // padding: 1rem 0;
10
+
11
+ position: relative;
12
+
13
+ background-color: #f4f4f4;
14
+ }
15
+
16
+ &__image {
17
+ height: auto;
18
+ margin: 0 auto;
19
+ }
20
+
21
+ &__toggle-transcript {
22
+ position: absolute;
23
+ right: 1rem;
24
+ bottom: 1rem;
25
+ }
26
+
27
+ &__transcript {
28
+ // @include colour.invert;
29
+ @extend %tna-invert;
30
+
31
+ padding: 1rem 1.5rem 0.5rem;
32
+
33
+ .tna-template--clicked &:focus {
34
+ outline: none;
35
+ }
36
+
37
+ .tna-tabs__list-item-link {
38
+ @include colour.colour-font("font-dark", true);
39
+
40
+ &::after {
41
+ @include colour.colour-background("keyline-dark", true);
42
+ }
43
+
44
+ .tna-template--js-enabled & {
45
+ @include colour.colour-font("font-light", true);
46
+
47
+ &--selected {
48
+ @include colour.colour-font("font-dark", true);
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ &__caption {
55
+ padding: 1rem 0;
56
+
57
+ // position: relative;
58
+
59
+ text-align: center;
60
+
61
+ border-bottom: 1px solid;
62
+ @include colour.colour-border("keyline");
63
+
64
+ // &::after {
65
+ // height: 1px;
66
+
67
+ // position: absolute;
68
+ // right: 20%;
69
+ // bottom: 0;
70
+ // left: 20%;
71
+
72
+ // @include colour.colour-background("keyline");
73
+
74
+ // content: "";
75
+ // }
76
+ }
77
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": "picture",
3
+ "fixtures": []
4
+ }