@nationalarchives/frontend 0.1.63 → 0.1.65

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 (162) hide show
  1. package/config/.babelrc.json +19 -0
  2. package/config/.eslintrc.js +25 -0
  3. package/config/.htmlvalidate.json +10 -0
  4. package/config/stylelint.config.js +239 -0
  5. package/nationalarchives/all.css +1 -3
  6. package/nationalarchives/all.css.map +1 -1
  7. package/nationalarchives/all.js +1 -1
  8. package/nationalarchives/all.js.map +1 -1
  9. package/nationalarchives/all.mjs +34 -0
  10. package/nationalarchives/all.scss +0 -2
  11. package/nationalarchives/components/_index.scss +1 -0
  12. package/nationalarchives/components/accordion/accordion.css +1 -1
  13. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  14. package/nationalarchives/components/accordion/accordion.js +1 -1
  15. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  16. package/nationalarchives/components/accordion/accordion.mjs +92 -24
  17. package/nationalarchives/components/accordion/accordion.scss +56 -18
  18. package/nationalarchives/components/accordion/accordion.stories.js +31 -9
  19. package/nationalarchives/components/accordion/fixtures.json +34 -7
  20. package/nationalarchives/components/accordion/macro-options.json +14 -2
  21. package/nationalarchives/components/accordion/template.njk +7 -5
  22. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  23. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  24. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +0 -10
  25. package/nationalarchives/components/breadcrumbs/template.njk +1 -1
  26. package/nationalarchives/components/button/button.css +1 -1
  27. package/nationalarchives/components/button/button.css.map +1 -1
  28. package/nationalarchives/components/button/button.scss +23 -1
  29. package/nationalarchives/components/button/button.stories.js +3 -0
  30. package/nationalarchives/components/button/macro-options.json +6 -0
  31. package/nationalarchives/components/button/template.njk +3 -1
  32. package/nationalarchives/components/card/card.css.map +1 -1
  33. package/nationalarchives/components/card/template.njk +5 -5
  34. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  35. package/nationalarchives/components/checkboxes/checkboxes.njk +1 -1
  36. package/nationalarchives/components/checkboxes/template.njk +1 -1
  37. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  38. package/nationalarchives/components/compound-filters/template.njk +1 -1
  39. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -1
  40. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  41. package/nationalarchives/components/cookie-banner/cookie-banner.scss +0 -2
  42. package/nationalarchives/components/cookie-banner/template.njk +1 -2
  43. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  44. package/nationalarchives/components/date-input/template.njk +1 -1
  45. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  46. package/nationalarchives/components/date-search/date-search.njk +2 -2
  47. package/nationalarchives/components/date-search/template.njk +1 -1
  48. package/nationalarchives/components/details/details.css.map +1 -1
  49. package/nationalarchives/components/details/template.njk +1 -1
  50. package/nationalarchives/components/error-summary/error-summary.css +1 -1
  51. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  52. package/nationalarchives/components/error-summary/template.njk +1 -1
  53. package/nationalarchives/components/featured-records/featured-records.css +1 -1
  54. package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
  55. package/nationalarchives/components/featured-records/featured-records.scss +1 -1
  56. package/nationalarchives/components/featured-records/template.njk +1 -1
  57. package/nationalarchives/components/files/_index.scss +1 -0
  58. package/nationalarchives/components/files/files.css +1 -0
  59. package/nationalarchives/components/files/files.css.map +1 -0
  60. package/nationalarchives/components/files/files.scss +79 -0
  61. package/nationalarchives/components/files/files.stories.js +59 -0
  62. package/nationalarchives/components/files/fixtures.json +71 -0
  63. package/nationalarchives/components/files/macro-options.json +58 -0
  64. package/nationalarchives/components/files/macro.njk +3 -0
  65. package/nationalarchives/components/files/template.njk +33 -0
  66. package/nationalarchives/components/footer/footer.css +1 -1
  67. package/nationalarchives/components/footer/footer.css.map +1 -1
  68. package/nationalarchives/components/footer/footer.scss +0 -2
  69. package/nationalarchives/components/footer/macro-options.json +0 -6
  70. package/nationalarchives/components/footer/template.njk +1 -1
  71. package/nationalarchives/components/gallery/fixtures.json +35 -1
  72. package/nationalarchives/components/gallery/gallery.css +1 -1
  73. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  74. package/nationalarchives/components/gallery/gallery.js +1 -1
  75. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  76. package/nationalarchives/components/gallery/gallery.mjs +192 -53
  77. package/nationalarchives/components/gallery/gallery.scss +318 -56
  78. package/nationalarchives/components/gallery/gallery.stories.js +45 -32
  79. package/nationalarchives/components/gallery/macro-options.json +34 -49
  80. package/nationalarchives/components/gallery/template.njk +70 -33
  81. package/nationalarchives/components/global-header/global-header.css +1 -1
  82. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  83. package/nationalarchives/components/global-header/global-header.scss +0 -2
  84. package/nationalarchives/components/global-header/template.njk +1 -1
  85. package/nationalarchives/components/grid/grid.css +1 -1
  86. package/nationalarchives/components/grid/grid.css.map +1 -1
  87. package/nationalarchives/components/grid/grid.scss +2 -2
  88. package/nationalarchives/components/grid/template.njk +1 -1
  89. package/nationalarchives/components/header/header.css +1 -1
  90. package/nationalarchives/components/header/header.css.map +1 -1
  91. package/nationalarchives/components/header/header.scss +3 -5
  92. package/nationalarchives/components/header/template.njk +1 -1
  93. package/nationalarchives/components/hero/hero.css.map +1 -1
  94. package/nationalarchives/components/hero/template.njk +1 -1
  95. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  96. package/nationalarchives/components/index-grid/template.njk +3 -3
  97. package/nationalarchives/components/pagination/pagination.css +1 -1
  98. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  99. package/nationalarchives/components/pagination/pagination.scss +1 -1
  100. package/nationalarchives/components/pagination/template.njk +1 -1
  101. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  102. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  103. package/nationalarchives/components/phase-banner/phase-banner.scss +0 -2
  104. package/nationalarchives/components/phase-banner/template.njk +1 -1
  105. package/nationalarchives/components/picture/picture.css.map +1 -1
  106. package/nationalarchives/components/picture/picture.js +1 -1
  107. package/nationalarchives/components/picture/picture.js.map +1 -1
  108. package/nationalarchives/components/picture/picture.mjs +2 -2
  109. package/nationalarchives/components/picture/template.njk +1 -1
  110. package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
  111. package/nationalarchives/components/quick-filters/template.njk +1 -1
  112. package/nationalarchives/components/radios/radios.css.map +1 -1
  113. package/nationalarchives/components/radios/radios.njk +1 -1
  114. package/nationalarchives/components/radios/template.njk +1 -1
  115. package/nationalarchives/components/search-field/search-field.css +1 -1
  116. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  117. package/nationalarchives/components/search-field/search-field.scss +2 -1
  118. package/nationalarchives/components/search-field/template.njk +2 -2
  119. package/nationalarchives/components/search-filters/search-filters.css.map +1 -1
  120. package/nationalarchives/components/search-filters/template.njk +1 -1
  121. package/nationalarchives/components/select/select.css.map +1 -1
  122. package/nationalarchives/components/select/template.njk +2 -2
  123. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  124. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  125. package/nationalarchives/components/sensitive-image/sensitive-image.scss +1 -1
  126. package/nationalarchives/components/sensitive-image/template.njk +1 -1
  127. package/nationalarchives/components/sidebar/fixtures.json +6 -6
  128. package/nationalarchives/components/sidebar/macro-options.json +9 -2
  129. package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
  130. package/nationalarchives/components/sidebar/sidebar.stories.js +9 -6
  131. package/nationalarchives/components/sidebar/template.njk +3 -3
  132. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  133. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  134. package/nationalarchives/components/skip-link/skip-link.scss +0 -2
  135. package/nationalarchives/components/skip-link/template.njk +1 -1
  136. package/nationalarchives/components/tabs/tabs.css +1 -1
  137. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  138. package/nationalarchives/components/tabs/tabs.scss +0 -12
  139. package/nationalarchives/components/tabs/template.njk +1 -1
  140. package/nationalarchives/components/text-input/template.njk +1 -1
  141. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  142. package/nationalarchives/components/text-input/text-input.njk +2 -2
  143. package/nationalarchives/components/textarea/template.njk +2 -2
  144. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  145. package/nationalarchives/components/warning/template.njk +1 -1
  146. package/nationalarchives/components/warning/warning.css.map +1 -1
  147. package/nationalarchives/components/warning/warning.scss +1 -0
  148. package/nationalarchives/global-header-package.css +1 -1
  149. package/nationalarchives/global-header-package.css.map +1 -1
  150. package/nationalarchives/print.css +6 -0
  151. package/nationalarchives/print.css.map +1 -0
  152. package/nationalarchives/print.scss +44 -0
  153. package/nationalarchives/prototype-kit.css +1 -3
  154. package/nationalarchives/prototype-kit.css.map +1 -1
  155. package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +28 -50
  156. package/nationalarchives/templates/layouts/_generic.njk +6 -6
  157. package/nationalarchives/tools/_a11y.scss +4 -0
  158. package/nationalarchives/tools/_colour.scss +52 -31
  159. package/nationalarchives/tools/_media.scss +0 -10
  160. package/nationalarchives/utilities/_overrides.scss +6 -0
  161. package/nationalarchives/utilities/_typography.scss +11 -10
  162. package/package.json +1 -1
@@ -1,78 +1,217 @@
1
- import uuidv4 from "../../lib/uuid.mjs";
2
-
3
1
  export class Gallery {
4
2
  constructor($module) {
5
3
  this.$module = $module;
6
- this.$items = $module && $module.querySelector(".tna-gallery__items");
7
- this.opened = false;
4
+ this.$itemsContainer =
5
+ $module && $module.querySelector(".tna-gallery__items");
6
+ this.$items =
7
+ this.$itemsContainer &&
8
+ this.$itemsContainer.querySelectorAll(".tna-gallery__item");
9
+ this.$navigation =
10
+ $module && $module.querySelector(".tna-gallery__navigation");
11
+ this.$navigationItems =
12
+ this.$navigation &&
13
+ $module.querySelectorAll(".tna-gallery__navigation-item");
14
+ this.$options = $module && $module.querySelector(".tna-gallery__options");
15
+ this.$navigationButtons =
16
+ $module && $module.querySelector(".tna-gallery__navigation-buttons");
8
17
 
9
- if (!this.$module || !this.$items) {
18
+ if (
19
+ !this.$module ||
20
+ !this.$itemsContainer ||
21
+ !this.$items ||
22
+ !this.$navigation ||
23
+ !this.$navigationItems ||
24
+ !this.$options ||
25
+ !this.$navigationButtons
26
+ ) {
10
27
  return;
11
28
  }
12
29
 
13
- const supportTouchHorizontal = false;
30
+ this.$module.classList.add("tna-gallery--js");
31
+
32
+ this.$showIndex = this.$options.querySelector('button[value="show-index"]');
33
+ this.$enterFullscreen = this.$options.querySelector(
34
+ 'button[value="enter-fullscreen"]',
35
+ );
36
+ this.$exitFullscreen = this.$options.querySelector(
37
+ 'button[value="exit-fullscreen"]',
38
+ );
14
39
 
15
- this.items = this.$module.querySelectorAll(".tna-gallery__item").length;
40
+ this.$navigationButtonPrev = this.$navigationButtons.querySelector(
41
+ ".tna-gallery__navigation-prev",
42
+ );
43
+ this.$navigationButtonNext = this.$navigationButtons.querySelector(
44
+ ".tna-gallery__navigation-next",
45
+ );
16
46
 
17
- if (this.items > 1) {
18
- const uniqueId = `tna-gallery-${uuidv4()}`;
47
+ this.$module.addEventListener("fullscreenchange", () =>
48
+ this.syncFullScreen(),
49
+ );
19
50
 
20
- this.$module.classList.add("tna-gallery--collapsed");
21
- this.$items.setAttribute("tabindex", "-1");
51
+ this.setup();
52
+ this.allowIndex = false;
53
+ if (this.allowIndex) {
54
+ this.showIndex();
55
+ } else {
56
+ this.currentId = this.$items[0].id;
57
+ this.showItem(this.currentId);
58
+ }
59
+ }
22
60
 
23
- this.$galleryToggle = document.createElement("button");
24
- this.$galleryToggle.classList.add(
25
- "tna-gallery__toggle",
26
- "tna-button",
27
- "tna-button--accent",
61
+ setup() {
62
+ this.$items.forEach(($item) => {
63
+ $item.setAttribute("hidden", "until-found");
64
+ $item.setAttribute("role", "tabpanel");
65
+ });
66
+ this.$navigation.removeAttribute("hidden");
67
+ this.$navigationItems.forEach(($item) => {
68
+ $item.addEventListener("click", () =>
69
+ this.showItem($item.getAttribute("aria-controls"), true),
70
+ );
71
+ });
72
+ this.$module.setAttribute("tabindex", "0");
73
+ this.$module.addEventListener("keydown", (e) => {
74
+ switch (e.key) {
75
+ case "ArrowLeft":
76
+ case "ArrowUp":
77
+ this.showPreviousItem();
78
+ break;
79
+ case "ArrowRight":
80
+ case "ArrowDown":
81
+ this.showNextItem();
82
+ break;
83
+ case "Home":
84
+ this.showFirstItem();
85
+ break;
86
+ case "End":
87
+ this.showLastItem();
88
+ break;
89
+ }
90
+ });
91
+ this.$options.removeAttribute("hidden");
92
+ if (
93
+ document.fullscreenEnabled &&
94
+ this.$enterFullscreen &&
95
+ this.$exitFullscreen
96
+ ) {
97
+ this.$enterFullscreen?.addEventListener("click", () =>
98
+ this.enterFullScreen(),
99
+ );
100
+ this.$exitFullscreen?.addEventListener("click", () =>
101
+ this.exitFullScreen(),
28
102
  );
29
- this.$galleryToggle.setAttribute("aria-controls", uniqueId);
30
- this.$galleryToggle.setAttribute("aria-expanded", false);
31
- this.$galleryToggle.innerText = `View ${this.items} images`;
103
+ this.$enterFullscreen?.removeAttribute("hidden");
104
+ }
105
+ this.$showIndex?.addEventListener("click", () => this.showIndex());
106
+ this.$navigationButtons?.removeAttribute("hidden");
107
+ this.$navigationButtonPrev?.addEventListener("click", () =>
108
+ this.showPreviousItem(),
109
+ );
110
+ this.$navigationButtonNext?.addEventListener("click", () =>
111
+ this.showNextItem(),
112
+ );
113
+ }
32
114
 
33
- const onFirstTouch = () => {
34
- this.$module.removeEventListener("touchstart", onFirstTouch);
35
- this.$module.classList.add("tna-gallery--touchable");
36
- };
115
+ showIndex() {
116
+ this.showItem("");
117
+ this.$itemsContainer.setAttribute("tabindex", "-1");
118
+ this.$showIndex?.setAttribute("hidden", true);
119
+ }
37
120
 
38
- if (supportTouchHorizontal) {
39
- this.$module.addEventListener("touchstart", onFirstTouch);
121
+ showItem(id, focusItem = false) {
122
+ this.$items.forEach(($item) => {
123
+ if (id && $item.id === id) {
124
+ $item.removeAttribute("hidden");
125
+ $item.removeAttribute("tabindex");
126
+ } else {
127
+ $item.setAttribute("hidden", "until-found");
128
+ $item.setAttribute("tabindex", "-1");
40
129
  }
41
-
42
- this.$galleryToggle.addEventListener("click", () => {
43
- if (supportTouchHorizontal) {
44
- this.$module.removeEventListener("touchstart", onFirstTouch);
130
+ });
131
+ this.$navigationItems.forEach(($item, index) => {
132
+ if (id) {
133
+ if ($item.getAttribute("aria-controls") === id) {
134
+ $item.setAttribute("aria-selected", "true");
135
+ $item.setAttribute("tabindex", "0");
136
+ // if (focusItem) {
137
+ // $item.focus();
138
+ // }
139
+ } else {
140
+ $item.setAttribute("aria-selected", "false");
141
+ $item.setAttribute("tabindex", "-1");
45
142
  }
46
- this.handleToggleGallery();
47
- });
48
-
49
- this.$galleryToggleWrapper = document.createElement("div");
50
- this.$galleryToggleWrapper.classList.add(
51
- "tna-column",
52
- "tna-column--full",
53
- "tna-gallery__toggle-wrapper",
54
- );
143
+ } else {
144
+ $item.setAttribute("aria-selected", "false");
145
+ $item.setAttribute("tabindex", index === 0 ? "0" : "-1");
146
+ }
147
+ });
148
+ if (this.allowIndex) {
149
+ this.$showIndex?.removeAttribute("hidden");
150
+ }
151
+ this.currentId = id;
152
+ this.$itemsContainer.setAttribute("tabindex", "0");
153
+ if (focusItem) {
154
+ this.$itemsContainer.focus();
155
+ }
156
+ }
157
+
158
+ getCurrentItemIndex() {
159
+ return Array.from(this.$items).findIndex(
160
+ ($item) => $item.id === this.currentId,
161
+ );
162
+ }
163
+
164
+ showPreviousItem() {
165
+ let nextIndexToShow = this.getCurrentItemIndex() - 1;
166
+ if (nextIndexToShow < 0) {
167
+ nextIndexToShow = this.$items.length - 1;
168
+ }
169
+ this.showItem(this.$items[nextIndexToShow].id, true);
170
+ }
171
+
172
+ showNextItem() {
173
+ let nextIndexToShow = this.getCurrentItemIndex() + 1;
174
+ if (nextIndexToShow >= this.$items.length) {
175
+ nextIndexToShow = 0;
176
+ }
177
+ this.showItem(this.$items[nextIndexToShow].id, true);
178
+ }
179
+
180
+ showFirstItem() {
181
+ this.showItem(this.$items[0].id, true);
182
+ }
55
183
 
56
- this.$galleryToggleWrapper.appendChild(this.$galleryToggle);
57
- this.$items.parentElement.appendChild(this.$galleryToggleWrapper);
184
+ showLastItem() {
185
+ this.showItem(this.$items[this.$items.length - 1].id, true);
186
+ }
58
187
 
59
- this.$items.setAttribute("id", uniqueId);
188
+ toggleFullScreen() {
189
+ if (!document.fullscreenElement) {
190
+ this.enterFullScreen();
191
+ } else if (document.exitFullscreen) {
192
+ this.exitFullScreen();
60
193
  }
61
194
  }
62
195
 
63
- handleToggleGallery() {
64
- this.opened = !this.opened;
65
- if (this.opened) {
66
- this.$module.classList.remove("tna-gallery--collapsed");
67
- this.$galleryToggle.setAttribute("aria-expanded", true);
68
- this.$galleryToggle.innerText = "Close images";
69
- this.$items.setAttribute("tabindex", "0");
70
- this.$items.focus();
71
- this.$items.setAttribute("tabindex", "-1");
196
+ enterFullScreen() {
197
+ this.$module.requestFullscreen();
198
+ this.syncFullScreen();
199
+ }
200
+
201
+ exitFullScreen() {
202
+ document.exitFullscreen();
203
+ this.syncFullScreen();
204
+ }
205
+
206
+ syncFullScreen() {
207
+ if (document.fullscreenElement) {
208
+ this.$enterFullscreen.setAttribute("hidden", true);
209
+ this.$exitFullscreen.removeAttribute("hidden");
210
+ this.$module.classList.add("tna-gallery--fullscreen");
72
211
  } else {
73
- this.$module.classList.add("tna-gallery--collapsed");
74
- this.$galleryToggle.setAttribute("aria-expanded", false);
75
- this.$galleryToggle.innerText = `View ${this.items} images`;
212
+ this.$exitFullscreen.setAttribute("hidden", true);
213
+ this.$enterFullscreen.removeAttribute("hidden");
214
+ this.$module.classList.remove("tna-gallery--fullscreen");
76
215
  }
77
216
  }
78
217
  }
@@ -1,116 +1,378 @@
1
+ @use "../../tools/a11y";
1
2
  @use "../../tools/colour";
2
3
  @use "../../tools/media";
3
4
  @use "../../tools/spacing";
5
+ @use "../../tools/typography";
4
6
 
5
7
  .tna-gallery {
6
- @include colour.contrast;
8
+ min-height: 100dvh;
9
+ max-height: 200dvh;
7
10
 
8
- padding-bottom: spacing.space(2);
11
+ display: grid;
12
+ grid-template: min-content min-content 1fr / 2fr 1fr;
13
+ gap: 0 spacing.space(1);
14
+
15
+ @include colour.tint;
16
+
17
+ border-radius: 0.1px;
18
+
19
+ &:active {
20
+ @include a11y.no-active-outline;
21
+ }
9
22
 
10
23
  &__header {
11
- padding-top: spacing.space(2);
24
+ padding: spacing.space(1);
25
+
26
+ grid-column: 1 / 3;
27
+ grid-row: 1;
28
+
29
+ display: flex;
30
+ gap: spacing.space(2);
31
+ }
32
+
33
+ &__header-inner {
34
+ flex: 1;
35
+ }
36
+
37
+ &__options {
38
+ margin-top: 0;
39
+
40
+ align-items: flex-start;
41
+
42
+ justify-content: flex-end;
43
+
44
+ flex: 1;
45
+
46
+ .tna-button {
47
+ white-space: nowrap;
48
+ }
49
+ }
50
+
51
+ &__items,
52
+ &__navigation-buttons {
53
+ grid-column: 1 / 3;
54
+ grid-row: 2;
12
55
  }
13
56
 
14
57
  &__items {
15
- width: 100%;
58
+ position: relative;
59
+ z-index: 1;
16
60
 
17
- display: flex;
18
- flex-direction: column;
19
- align-items: center;
20
- gap: spacing.space(3);
61
+ border-radius: 0.1px;
21
62
 
22
- &:focus {
23
- outline: none !important;
63
+ .tna-template--clicked &:focus {
64
+ outline: none;
24
65
  }
25
66
  }
26
67
 
27
68
  &__item {
28
- margin: 0;
69
+ display: flex;
70
+ flex-direction: column;
71
+ align-items: stretch;
72
+ justify-content: center;
73
+ }
29
74
 
30
- &-index {
31
- padding-bottom: spacing.space(1);
75
+ &__item-header {
76
+ padding: spacing.space(1);
32
77
 
33
- text-align: center;
34
- }
78
+ line-height: 1;
79
+ text-align: center;
80
+
81
+ @include typography.main-font-weight-bold;
82
+ @include typography.font-size(16);
83
+ }
84
+
85
+ &__item-figure {
86
+ display: flex;
87
+ flex-direction: column;
88
+ align-items: stretch;
89
+ gap: spacing.space(1);
90
+ }
91
+
92
+ &__item-figure-inner {
93
+ width: 100%;
94
+ max-height: 50vh;
95
+
96
+ position: relative;
97
+
98
+ @include colour.contrast;
99
+ }
100
+
101
+ &__item-image {
102
+ margin: 0 auto;
103
+ }
104
+
105
+ &__item-description {
106
+ margin: 0 spacing.space(1) spacing.space(1);
107
+ padding: spacing.space(0.5) spacing.space(1);
108
+
109
+ align-self: flex-start;
110
+
111
+ @include colour.thick-keyline-dark(left);
112
+ }
113
+
114
+ &__navigation-buttons {
115
+ width: 100%;
116
+ max-height: 50vh;
117
+
118
+ position: relative;
119
+ top: 3rem;
120
+ z-index: 2;
121
+
122
+ aspect-ratio: 3 / 2;
123
+
124
+ pointer-events: none;
35
125
 
36
- &-figure {
126
+ .tna-template--touched & {
127
+ display: none;
37
128
  }
129
+ }
130
+
131
+ &__navigation-button {
132
+ width: 25%;
133
+ padding: 0;
134
+
135
+ position: absolute;
136
+ top: 0;
137
+ bottom: 0;
138
+
139
+ border: none;
38
140
 
39
- &-image {
40
- height: auto;
141
+ opacity: 0;
142
+
143
+ cursor: pointer;
144
+ pointer-events: auto;
145
+
146
+ @include colour.colour-font("base-dark");
147
+
148
+ @include colour.tint;
149
+
150
+ svg {
151
+ height: 5vw;
41
152
  margin: 0 auto;
153
+
154
+ display: block;
155
+
156
+ fill: currentColor;
157
+ }
158
+
159
+ &:hover,
160
+ &:focus {
161
+ opacity: 1;
42
162
  }
163
+ }
164
+
165
+ &__navigation-prev {
166
+ padding-right: 10%;
167
+
168
+ left: 0;
169
+
170
+ background: linear-gradient(
171
+ 90deg,
172
+ var(--background) 15%,
173
+ rgb(0 0 0 / 0%) 100%
174
+ );
175
+ }
176
+
177
+ &__navigation-next {
178
+ padding-left: 10%;
179
+
180
+ right: 0;
181
+
182
+ background: linear-gradient(
183
+ 270deg,
184
+ var(--background) 15%,
185
+ rgb(0 0 0 / 0%) 100%
186
+ );
187
+ }
188
+
189
+ &__navigation {
190
+ padding: spacing.space(1);
191
+
192
+ grid-column: 1 / 3;
193
+ grid-row: 3;
194
+
195
+ display: grid;
196
+ grid-template-columns: repeat(6, 1fr);
197
+ grid-auto-rows: min-content;
198
+ gap: spacing.space(1);
199
+
200
+ overflow: auto;
201
+ }
202
+
203
+ &__navigation-item {
204
+ aspect-ratio: 1;
205
+
206
+ min-width: 0;
207
+ min-height: 0;
208
+
209
+ position: relative;
210
+
211
+ border: none;
212
+
213
+ @include colour.contrast;
214
+
215
+ cursor: pointer;
216
+
217
+ &:hover {
218
+ &::after {
219
+ content: "";
43
220
 
44
- &-description {
45
- margin-top: spacing.space(1);
46
- padding: spacing.space(0.5) 0 spacing.space(0.5) spacing.space(1);
221
+ position: absolute;
222
+ inset: 0;
223
+ z-index: 2;
47
224
 
48
- @include colour.colour-border("keyline-dark", 4px, solid, left);
225
+ @include colour.thick-keyline-accent;
226
+ }
49
227
  }
50
228
 
51
- &-tabs {
52
- @include media.on-smaller-than-large {
53
- padding-top: spacing.space(2);
229
+ &[aria-selected="true"] {
230
+ @include colour.accent;
231
+
232
+ &::after {
233
+ content: "";
234
+
235
+ position: absolute;
236
+ inset: 0;
237
+ z-index: 2;
238
+
239
+ @include colour.thick-keyline-brand("", "black");
54
240
  }
55
241
  }
56
242
  }
57
243
 
58
- &__item + &__item {
59
- @include colour.colour-border("keyline", 1px, solid, top);
244
+ &__navigation-item-image {
245
+ width: 100%;
246
+ height: 100%;
247
+
248
+ position: absolute;
249
+ inset: 0;
250
+ object-fit: cover;
60
251
  }
61
252
 
62
- &__toggle-wrapper {
63
- text-align: center;
253
+ &__navigation-item-label {
254
+ padding: spacing.space(0.25) spacing.space(0.75);
255
+
256
+ display: inline-block;
257
+
258
+ position: absolute;
259
+ right: 0;
260
+ bottom: 0;
261
+ z-index: 4;
262
+
263
+ @include colour.colour-font("font-dark");
264
+ @include typography.font-size(36);
265
+ @include typography.main-font-weight-bold;
266
+ text-transform: capitalize;
267
+
268
+ @include colour.colour-background("background");
64
269
  }
65
270
 
66
- &__toggle {
67
- margin-top: spacing.space(2);
271
+ &--js &__item-figure-inner {
272
+ aspect-ratio: 3 / 2;
68
273
  }
69
274
 
70
- &--touchable {
71
- .tna-gallery__items {
72
- flex-flow: row nowrap;
275
+ &--js &__item-image {
276
+ width: 100%;
277
+ height: 100%;
73
278
 
74
- gap: spacing.space(6);
279
+ position: absolute;
280
+ inset: 0;
281
+ z-index: 1;
282
+ object-fit: contain;
283
+ }
75
284
 
76
- overflow-x: scroll;
77
- scroll-snap-type: x mandatory;
285
+ @include media.on-medium {
286
+ &__navigation {
287
+ grid-template-columns: repeat(4, 1fr);
78
288
  }
79
289
 
80
- .tna-gallery__item {
81
- width: 100%;
290
+ &__navigation-item-label {
291
+ @include typography.font-size(30);
292
+ }
293
+ }
82
294
 
83
- scroll-snap-align: center;
84
- flex: none;
295
+ @include media.on-mobile {
296
+ &__navigation {
297
+ grid-template-columns: repeat(3, 1fr);
85
298
  }
299
+ }
86
300
 
87
- &.tna-gallery--collapsed {
88
- .tna-gallery__items {
89
- overflow: auto;
90
- }
301
+ @include media.on-tiny {
302
+ &__options {
303
+ align-items: flex-end;
304
+ justify-content: flex-start;
305
+ }
306
+
307
+ &__navigation-item-label {
308
+ @include typography.font-size(24);
91
309
  }
92
310
  }
93
311
 
94
- &--collapsed &__item + &__item,
95
- &--collapsed &__item:first-child &__item-description,
96
- &--collapsed &__item:first-child &__item-tabs {
312
+ &--fullscreen {
313
+ max-height: 100dvh;
314
+ }
315
+
316
+ &--fullscreen &__header-inner {
97
317
  display: none;
98
318
  }
99
319
 
100
- &--collapsed &__item-figure {
101
- width: 100%;
320
+ &--fullscreen &__item-description {
321
+ max-height: 4.5rem;
322
+
323
+ overflow: auto;
102
324
  }
103
325
 
104
- @include colour.on-high-contrast {
105
- &__items {
326
+ // @media (display-mode: fullscreen) and (aspect-ratio >= 1/1), (display-mode: fullscreen) and (orientation: landscape) {
327
+ @media (aspect-ratio >= 1/1) {
328
+ &--fullscreen &__header {
329
+ grid-column: 2 / 3;
330
+ // padding-bottom: spacing.space(0.5);
106
331
  }
107
332
 
108
- &__item {
109
- &-index {
333
+ &--fullscreen &__options {
334
+ .tna-button[value="show-index"] {
335
+ display: none;
110
336
  }
337
+ }
111
338
 
112
- &-description {
113
- }
339
+ &--fullscreen &__items,
340
+ &--fullscreen &__navigation-buttons {
341
+ grid-column: 1 / 2;
342
+ grid-row: 1 / 4;
343
+ }
344
+
345
+ &--fullscreen &__item {
346
+ height: 100%;
347
+ }
348
+
349
+ &--fullscreen &__item-header {
350
+ // padding-top: spacing.space(0.5);
351
+ // padding-bottom: spacing.space(0.5);
352
+ }
353
+
354
+ &--fullscreen &__item-figure {
355
+ flex: 1;
356
+ }
357
+
358
+ &--fullscreen &__item-figure-inner,
359
+ &--fullscreen &__navigation-buttons {
360
+ max-height: none;
361
+ flex: 1;
362
+ aspect-ratio: auto;
363
+ }
364
+
365
+ &--fullscreen &__navigation {
366
+ // padding-top: spacing.space(0.5);
367
+ padding-top: 0;
368
+ padding-left: 0;
369
+
370
+ grid-column: 2 / 3;
371
+ grid-row: 2 / 4;
372
+
373
+ // grid-template-columns: repeat(3, minmax(8rem, 1fr));
374
+ grid-template-columns: repeat(3, 1fr);
375
+ gap: spacing.space(0.5);
114
376
  }
115
377
  }
116
378
  }