@qhealth-design-system/core 1.18.4 → 1.19.0

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 (90) hide show
  1. package/.storybook/assets/accordion-js.js +344 -0
  2. package/.storybook/assets/animate-js.js +247 -0
  3. package/.storybook/assets/index.js +15 -0
  4. package/.storybook/globals.js +39 -41
  5. package/.storybook/main.js +4 -3
  6. package/.storybook/preview.js +11 -13
  7. package/CHANGELOG.md +2 -0
  8. package/README.md +1 -1
  9. package/package.json +10 -15
  10. package/src/component-loader.js +23 -0
  11. package/src/components/_global/css/body/component.scss +3 -3
  12. package/src/components/_global/css/btn/component.scss +1 -1
  13. package/src/components/_global/css/cta_links/component.scss +2 -2
  14. package/src/components/_global/css/example/component.scss +11 -19
  15. package/src/components/_global/css/forms/control_inputs/component.scss +2 -2
  16. package/src/components/_global/css/forms/general/component.scss +5 -5
  17. package/src/components/_global/css/headings/component.scss +42 -44
  18. package/src/components/_global/css/img/images.scss +20 -36
  19. package/src/components/_global/css/link_columns/component.scss +2 -2
  20. package/src/components/_global/css/modal/component.scss +20 -26
  21. package/src/components/_global/css/table/component.scss +14 -21
  22. package/src/components/_global/css/tabs/component.scss +2 -2
  23. package/src/components/_global/css/tags/component.scss +1 -1
  24. package/src/components/_global/css/toggle_and_tool_tip/component.scss +3 -3
  25. package/src/components/_global/js/global.js +1 -1
  26. package/src/components/_global/js/select_boxes/global.js +26 -35
  27. package/src/components/accordion/css/component.scss +289 -326
  28. package/src/components/banner/css/component.scss +77 -173
  29. package/src/components/banner/html/component.hbs +2 -4
  30. package/src/components/banner_advanced/html/component.hbs +2 -2
  31. package/src/components/banner_advanced/js/manifest.json +1422 -1386
  32. package/src/components/basic_search/css/component.scss +13 -14
  33. package/src/components/basic_search/html/component.hbs +11 -20
  34. package/src/components/breadcrumbs/js/global.js +6 -1
  35. package/src/components/callout/css/component.scss +37 -40
  36. package/src/components/card_feature/css/component.scss +28 -167
  37. package/src/components/card_multi_action/css/component.scss +46 -58
  38. package/src/components/code/css/component.scss +3 -3
  39. package/src/components/code/html/component.hbs +12 -12
  40. package/src/components/code/js/global.js +6 -1
  41. package/src/components/file_upload/css/component.scss +5 -5
  42. package/src/components/file_upload/js/global.js +46 -43
  43. package/src/components/footer/css/component.scss +3 -3
  44. package/src/components/global_alert/css/component.scss +8 -14
  45. package/src/components/global_alert/html/component.hbs +3 -3
  46. package/src/components/header/css/component.scss +16 -4
  47. package/src/components/header/html/component.hbs +3 -2
  48. package/src/components/in_page_navigation/css/component.scss +14 -16
  49. package/src/components/in_page_navigation/js/global.js +48 -58
  50. package/src/components/internal_navigation/css/component.scss +3 -3
  51. package/src/components/internal_navigation/js/global.js +27 -35
  52. package/src/components/left_hand_navigation/css/component.scss +8 -2
  53. package/src/components/main_navigation/css/component.scss +16 -7
  54. package/src/components/main_navigation/html/component.hbs +1 -0
  55. package/src/components/mega_main_navigation/css/component.scss +5 -5
  56. package/src/components/mega_main_navigation/html/component.hbs +1 -0
  57. package/src/components/pagination/css/component.scss +32 -28
  58. package/src/components/pagination/html/component.hbs +37 -40
  59. package/src/components/promo_panel/css/component.scss +1 -4
  60. package/src/components/promo_panel/html/component.hbs +11 -5
  61. package/src/components/promo_panel/js/global.js +24 -39
  62. package/src/components/promo_panel/js/manifest.json +8 -0
  63. package/src/components/tab/css/component.scss +3 -3
  64. package/src/components/toggle_tip/css/component.scss +1 -1
  65. package/src/components/tool_tip/css/component.scss +1 -1
  66. package/src/components/video_player/js/global.js +16 -13
  67. package/src/data/current.json +33 -1
  68. package/src/helpers/global-helpers.js +56 -0
  69. package/src/html/component-in_page_navigation.html +2 -2
  70. package/src/index.js +4 -8
  71. package/src/stories/BackToTop/BackToTop.mdx +3 -21
  72. package/src/stories/CTALink/CTALink.mdx +1 -4
  73. package/src/stories/Checkboxes/Checkboxes.mdx +1 -4
  74. package/src/stories/DirectionLinks/DirectionLinks.mdx +1 -4
  75. package/src/stories/InPageAlert/InPageAlert.mdx +1 -4
  76. package/src/stories/Introduction.mdx +9 -5
  77. package/src/stories/LinkColumns/LinkColumns.mdx +1 -4
  78. package/src/stories/Pagination/Pagination.mdx +26 -0
  79. package/src/stories/Pagination/Pagination.stories.js +257 -0
  80. package/src/stories/PromoPanel/PromoPanel.mdx +26 -0
  81. package/src/stories/PromoPanel/PromoPanel.stories.js +219 -0
  82. package/src/stories/RadioButtons/RadioButtons.mdx +1 -4
  83. package/src/stories/SelectBox/SelectBox.mdx +1 -4
  84. package/src/stories/Tags/Tags.js +3 -3
  85. package/src/stories/Tags/Tags.mdx +1 -4
  86. package/src/stories/VideoPlayer/VideoPlayer.mdx +3 -28
  87. package/src/stories/VideoPlayer/VideoPlayer.stories.js +19 -46
  88. package/src/styles/imports/utilities.scss +3 -3
  89. package/src/styles/imports/variables.scss +5 -0
  90. package/src/stories/VideoPlayer/VideoPlayer.js +0 -0
@@ -100,7 +100,7 @@
100
100
 
101
101
  > .qld__left-nav__item-link .qld__left-nav__item-text {
102
102
  color: var(--QLD-color-light__heading);
103
- font-weight: bold;
103
+ font-weight: $QLD-font-weight-semibold;
104
104
  }
105
105
 
106
106
  > .qld__left-nav__item-link ~ .qld__accordion--closed {
@@ -281,12 +281,14 @@
281
281
  background-color: var(--QLD-color-dark__design-accent);
282
282
  }
283
283
 
284
- &:hover {
284
+ // Hover over the full nav link only if the children are not expanded
285
+ &:not(:has(.qld__left-nav__item-link--open)):hover {
285
286
  background-color: var(--QLD-color-dark__background--alt);
286
287
  }
287
288
 
288
289
  a.qld__left-nav__item-link:hover {
289
290
  background-color: var(--QLD-color-dark__background--alt);
291
+ color: var(--QLD-color-dark__link);
290
292
 
291
293
  .qld__left-nav__item-icon svg {
292
294
  color: var(--QLD-color-dark__action--primary-hover);
@@ -316,6 +318,10 @@
316
318
  }
317
319
  }
318
320
 
321
+ .qld__left-nav__item-toggle {
322
+ @include QLD-focus("dark", false);
323
+ }
324
+
319
325
  ul {
320
326
  background-color: var(--QLD-color-dark__background);
321
327
 
@@ -1,6 +1,6 @@
1
- // //--------------------------------------------------------------------------------------------------------------------------------------------------------------
2
- // // Main Navigation
3
- // //--------------------------------------------------------------------------------------------------------------------------------------------------------------
1
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------
2
+ // Main Navigation
3
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------
4
4
 
5
5
  $QLD-main-nav-breakpoint: md !default;
6
6
  $QLD-main-nav-width: 320px !default;
@@ -95,7 +95,7 @@ $QLD-header-md: 72px;
95
95
  }
96
96
 
97
97
  &.active .qld__main-nav__item-link {
98
- font-weight: bold;
98
+ font-weight: $QLD-font-weight-semibold;
99
99
  color: var(--QLD-color-light__heading);
100
100
  border-left-color: transparent;
101
101
 
@@ -228,7 +228,7 @@ $QLD-header-md: 72px;
228
228
  color: var(--QLD-color-light__text);
229
229
  background-color: $QLD-color-neutral--white;
230
230
  border-left-color: $QLD-color-neutral--lightest;
231
- font-weight: bold;
231
+ font-weight: $QLD-font-weight-semibold;
232
232
 
233
233
  .qld__main-nav__item-icon {
234
234
  stroke-width: 10px;
@@ -264,7 +264,7 @@ $QLD-header-md: 72px;
264
264
  overflow: hidden;
265
265
  user-select: none;
266
266
  pointer-events: none;
267
- font-weight: bold;
267
+ font-weight: $QLD-font-weight-semibold;
268
268
  }
269
269
  }
270
270
 
@@ -414,7 +414,7 @@ $QLD-header-md: 72px;
414
414
  & &__menu-heading {
415
415
  @include QLD-fontgrid(xs);
416
416
  @include QLD-space(margin, 0unit 1unit);
417
- font-weight: normal;
417
+ font-weight: $QLD-font-weight-regular;
418
418
  color: var(--QLD-color-light__heading);
419
419
 
420
420
  @include QLD-media(md) {
@@ -747,6 +747,15 @@ $QLD-header-md: 72px;
747
747
 
748
748
  // CTA wrapper
749
749
  .qld__main-nav__cta-wrapper {
750
+ &.qld__main-nav__cta-wrapper--light {
751
+ .qld__main-nav__item-link {
752
+ color: var(--QLD-color-light__link);
753
+
754
+ &:hover {
755
+ text-decoration-color: var(--QLD-color-light__underline--hover);
756
+ }
757
+ }
758
+ }
750
759
  &.qld__main-nav__cta-wrapper--dark,
751
760
  &.qld__main-nav__cta-wrapper--dark-alt {
752
761
  .qld__link-list .qld__main-nav__item .qld__main-nav__item-title a.qld__main-nav__item-link:hover {
@@ -49,6 +49,7 @@
49
49
  {{/ifCond}}
50
50
  {{#ifCond site.metadata.mainNavCtaOne.value '||' site.metadata.mainNavCtaTwo.value}}
51
51
  <div class="qld__main-nav__cta-wrapper
52
+ {{#ifCond site.metadata.sitePreHeaderTheme.value '==' ''}}qld__main-nav__cta-wrapper--light{{/ifCond}}
52
53
  {{#ifCond site.metadata.sitePreHeaderTheme.value '==' 'qld__header__pre-header--dark'}}qld__main-nav__cta-wrapper--dark{{/ifCond}}
53
54
  {{#ifCond site.metadata.sitePreHeaderTheme.value '==' 'qld__header__pre-header--dark-alt'}}qld__main-nav__cta-wrapper--dark-alt{{/ifCond}}
54
55
  ">
@@ -90,7 +90,7 @@
90
90
  overflow: hidden;
91
91
  user-select: none;
92
92
  pointer-events: none;
93
- font-weight: bold;
93
+ font-weight: $QLD-font-weight-semibold;
94
94
  }
95
95
  }
96
96
 
@@ -301,7 +301,7 @@
301
301
  @include QLD-media(lg) {
302
302
  padding: 0;
303
303
  border-bottom: none;
304
- font-weight: bold;
304
+ font-weight: $QLD-font-weight-semibold;
305
305
  }
306
306
 
307
307
  .qld__icon {
@@ -339,7 +339,7 @@
339
339
  .qld__main-nav__item-desc {
340
340
  color: var(--QLD-color-light__text--lighter);
341
341
  @include QLD-fontgrid(xs);
342
- font-weight: normal;
342
+ font-weight: $QLD-font-weight-regular;
343
343
  }
344
344
 
345
345
  &.active {
@@ -347,7 +347,7 @@
347
347
  color: var(--QLD-color-light__heading);
348
348
  width: 100%;
349
349
  display: block;
350
- font-weight: bold;
350
+ font-weight: $QLD-font-weight-semibold;
351
351
  border-left: solid 4px transparent;
352
352
 
353
353
  @include QLD-media(lg) {
@@ -366,7 +366,7 @@
366
366
  }
367
367
 
368
368
  &:not(.active) {
369
- font-weight: normal;
369
+ font-weight: $QLD-font-weight-regular;
370
370
  }
371
371
 
372
372
  &.qld__main-nav__item--has-desc {
@@ -114,6 +114,7 @@
114
114
  {{/ifCond}}
115
115
  {{#ifCond site.metadata.mainNavCtaOne.value '||' site.metadata.mainNavCtaTwo.value}}
116
116
  <div class="qld__main-nav__cta-wrapper
117
+ {{#ifCond site.metadata.sitePreHeaderTheme.value '==' ''}}qld__main-nav__cta-wrapper--light{{/ifCond}}
117
118
  {{#ifCond site.metadata.sitePreHeaderTheme.value '==' 'qld__header__pre-header--dark'}}qld__main-nav__cta-wrapper--dark{{/ifCond}}
118
119
  {{#ifCond site.metadata.sitePreHeaderTheme.value '==' 'qld__header__pre-header--dark-alt'}}qld__main-nav__cta-wrapper--dark-alt{{/ifCond}}
119
120
  ">
@@ -9,7 +9,7 @@
9
9
  flex-wrap: wrap;
10
10
 
11
11
  li {
12
- @include QLD-space(margin, .5unit .75unit .5unit 0);
12
+ @include QLD-space(margin, 0.5unit 0.75unit 0.5unit 0);
13
13
 
14
14
  &.ellipsis,
15
15
  &.first,
@@ -31,10 +31,9 @@
31
31
  background-color: var(--QLD-color-light__action--primary);
32
32
  box-shadow: inset 0 0 0 $QLD-border-width-thin var(--QLD-color-light__action--primary);
33
33
  color: var(--QLD-color-light__link--on-action);
34
- font-weight: bold;
34
+ font-weight: $QLD-font-weight-semibold;
35
35
 
36
-
37
- &:hover{
36
+ &:hover {
38
37
  background-color: var(--QLD-color-light__action--primary-hover);
39
38
  color: var(--QLD-color-light__link--on-action);
40
39
  box-shadow: inset 0 0 0 $QLD-border-width-default var(--QLD-color-light__action--primary-hover);
@@ -52,19 +51,20 @@
52
51
  }
53
52
 
54
53
  &.next,
55
- &.prev{
56
- @include QLD-underline('light','noUnderline');
54
+ &.prev {
55
+ @include QLD-underline("light", "noUnderline");
57
56
  }
58
57
 
59
58
  &.next,
60
59
  &.prev,
61
- &.ellipsis{
62
- a, button{
60
+ &.ellipsis {
61
+ a,
62
+ button {
63
63
  box-shadow: none;
64
64
  @include QLD-media(lg) {
65
65
  width: auto;
66
66
  }
67
-
67
+
68
68
  &:hover span {
69
69
  text-decoration-thickness: var(--QLD-underline__thickness-thick);
70
70
  text-decoration: underline;
@@ -75,8 +75,8 @@
75
75
  text-decoration: underline;
76
76
  }
77
77
  }
78
-
79
- span{
78
+
79
+ span {
80
80
  @include QLD-sronly();
81
81
  @include QLD-media(lg) {
82
82
  position: relative;
@@ -88,21 +88,23 @@
88
88
  }
89
89
 
90
90
  @include QLD-media(lg) {
91
- &.next span{
92
- @include QLD-space(margin-right, .5unit);
91
+ &.next span {
92
+ @include QLD-space(margin-right, 0.5unit);
93
93
  }
94
- &.prev span{
95
- @include QLD-space(margin-left, .5unit);
94
+ &.prev span {
95
+ @include QLD-space(margin-left, 0.5unit);
96
96
  }
97
97
  }
98
98
 
99
- &.ellipsis svg{
99
+ &.ellipsis svg {
100
100
  vertical-align: middle;
101
101
  }
102
102
  }
103
103
 
104
- .mid, .num {
105
- a, button {
104
+ .mid,
105
+ .num {
106
+ a,
107
+ button {
106
108
  &:active,
107
109
  &:focus {
108
110
  background-color: transparent;
@@ -111,7 +113,8 @@
111
113
  }
112
114
  }
113
115
 
114
- a, button {
116
+ a,
117
+ button {
115
118
  text-decoration: none;
116
119
  @include QLD-space(height, 2unit);
117
120
  @include QLD-space(min-width, 2unit);
@@ -120,7 +123,6 @@
120
123
  background-color: transparent;
121
124
  border-radius: $QLD-border-radius-xs;
122
125
  color: var(--QLD-color-light__link);
123
- background-color: $QLD-color-neutral--white;
124
126
  display: inline-flex;
125
127
  justify-content: center;
126
128
  @include QLD-space(line-height, 1.25unit);
@@ -158,7 +160,8 @@
158
160
  }
159
161
  }
160
162
 
161
- .qld__body--dark & ul.qld__search-pagination__list {
163
+ .qld__body--dark & ul.qld__search-pagination__list,
164
+ .qld__body--dark-alt & ul.qld__search-pagination__list {
162
165
  li {
163
166
  & button {
164
167
  outline: 3px solid var(--QLD-color-light__focus);
@@ -179,7 +182,7 @@
179
182
 
180
183
  &:active,
181
184
  &:focus {
182
- @include QLD-focus('dark');
185
+ @include QLD-focus("dark");
183
186
  background-color: var(--QLD-color-dark__action--primary-hover);
184
187
  box-shadow: inset 0 0 0 $QLD-border-width-thin var(--QLD-color-dark__action--primary-hover) !important;
185
188
  color: var(--QLD-color-dark__link--on-action);
@@ -188,11 +191,12 @@
188
191
 
189
192
  &.next,
190
193
  &.prev,
191
- &.ellipsis{
192
- a, button {
194
+ &.ellipsis {
195
+ a,
196
+ button {
193
197
  box-shadow: none;
194
198
 
195
- &:hover{
199
+ &:hover {
196
200
  box-shadow: none;
197
201
  color: var(--QLD-color-dark__link);
198
202
 
@@ -250,7 +254,7 @@
250
254
  text-decoration-color: var(--QLD-color-dark__underline);
251
255
  text-decoration-thickness: var(--QLD-underline__thickness-thin);
252
256
  }
253
-
257
+
254
258
  &:focus span,
255
259
  &:hover span {
256
260
  text-decoration-color: var(--QLD-color-dark__link);
@@ -258,7 +262,7 @@
258
262
  }
259
263
  }
260
264
  }
261
-
265
+
262
266
  a,
263
267
  button {
264
268
  background-color: transparent;
@@ -283,4 +287,4 @@
283
287
  color: var(--QLD-color-dark__link);
284
288
  }
285
289
  }
286
- }
290
+ }
@@ -1,44 +1,41 @@
1
- <div class="qld__body qld__body--dark">
2
- <nav class="hidden-print qld__search-pagination" aria-label="pagination">
3
- <h2 class="sr-only">Pagination</h2>
4
- <ul class="qld__search-pagination__list">
5
- {{#each pagination}}
6
- {{#ifCond linkType '===' 'last'}}
7
- <li class="ellipsis">
8
- <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--lg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#more-horizontal"></use></svg>
9
- </li>
10
- {{/ifCond}}
1
+ <nav class="text-center hidden-print qld__search-pagination" aria-label="pagination">
2
+ <h2 class="sr-only">Pagination</h2>
3
+ <ul class="qld__search-pagination__list">
4
+ {{#each pagination}}
5
+ {{#ifCond linkType '===' 'last'}}
6
+ <li class="ellipsis">
7
+ <svg class="qld__icon qld__icon--lg" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href="{{@root.site.metadata.coreSiteIcons.value}}#more-horizontal"></use></svg>
8
+ </li>
9
+ {{/ifCond}}
11
10
 
11
+ {{#ifCond linkType '===' 'prev'}}
12
+ <li class="prev">
13
+ <a href="{{{url}}}" rel="prev" aria-label="Previous page of results">
14
+ <svg class="qld__icon qld__icon--sm" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href="{{@root.site.metadata.coreSiteIcons.value}}#arrow-left"></use></svg>
15
+ <span>Back</span>
16
+ </a>
17
+ {{/ifCond}}
12
18
 
13
- {{#ifCond linkType '===' 'prev'}}
14
- <li class="prev">
15
- <a href="{{url}}" rel="prev" aria-label="Previous page of results" class="qld__search-pagination_link">
16
- <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--sm"><use href="{{@root.site.metadata.coreSiteIcons.value}}#arrow-left"></use></svg>
17
- <span>Back</span>
18
- </a>
19
- {{/ifCond}}
20
-
21
- {{#if label}}
22
- <li class="{{linkType}}{{#if isCurrent}} active{{/if}}">
23
- <a class="qld__search-pagination_link" href="{{url}}" aria-current="page">{{label}}</a>
24
- </li>
25
- {{/if}}
19
+ {{#if label}}
20
+ <li class="{{linkType}}{{#if isCurrent}} active{{/if}}">
21
+ <a href="{{{url}}}"{{#if isCurrent}} aria-current="page"{{/if}}>{{label}}</a>
22
+ </li>
23
+ {{/if}}
26
24
 
27
- {{#ifCond linkType '===' 'next'}}
28
- <li class="next">
29
- <a href="{{url}}" rel="next" aria-label="Next page of results" class="qld__search-pagination_link">
30
- <span>Next</span>
31
- <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--sm"><use href="{{@root.site.metadata.coreSiteIcons.value}}#arrow-right"></use></svg>
32
- </a>
33
- {{/ifCond}}
25
+ {{#ifCond linkType '===' 'next'}}
26
+ <li class="next">
27
+ <a href="{{{url}}}" rel="next" aria-label="Next page of results">
28
+ <span>Next</span>
29
+ <svg class="qld__icon qld__icon--sm" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href="{{@root.site.metadata.coreSiteIcons.value}}#arrow-right"></use></svg>
30
+ </a>
31
+ </li>
32
+ {{/ifCond}}
33
+
34
+ {{#ifCond linkType '===' 'first'}}
35
+ <li class="ellipsis">
36
+ <svg class="qld__icon qld__icon--sm" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href="{{@root.site.metadata.coreSiteIcons.value}}#more-horizontal"></use></svg>
34
37
  </li>
35
-
36
- {{#ifCond linkType '===' 'first'}}
37
- <li class="ellipsis">
38
- <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--lg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#more-horizontal"></use></svg>
39
- </li>
40
- {{/ifCond}}
41
- {{/each}}
42
- </ul>
43
- </nav>
44
- </div>
38
+ {{/ifCond}}
39
+ {{/each}}
40
+ </ul>
41
+ </nav>
@@ -390,10 +390,6 @@
390
390
  background: white;
391
391
  clip-path: none;
392
392
  }
393
-
394
- // .qld__promo-panel__container-icon {
395
- // background: var(--QLD-color-light__background--shade);
396
- // }
397
393
  }
398
394
 
399
395
  &.qld__body--light {
@@ -523,6 +519,7 @@
523
519
  .qld__promo-panel__icon {
524
520
  color: var(--QLD-color-dark__action--secondary);
525
521
  }
522
+
526
523
  .qld__promo-panel__container-icon {
527
524
  background: var(--QLD-color-dark__background--alt-shade);
528
525
  }
@@ -9,11 +9,17 @@
9
9
  </div>
10
10
  <div class="qld__promo-panel__container-content">
11
11
  <div class="qld__promo-panel__container-inner">
12
- {{#if metadata.icon.value}}
13
- <div class="qld__promo-panel__container-icon">
14
- <i class="qld__promo-panel__icon {{metadata.icon.value}}"></i>
15
- </div>
16
- {{/if}}
12
+ {{!-- TODO: Remove the icon metadata once all instances have been updated to use promo_panel_icon --}}
13
+ {{#ifCond metadata.icon.value '||' metadata.promo_panel_icon.value}}
14
+ <div class="qld__promo-panel__container-icon">
15
+ {{#if metadata.promo_panel_icon.value}}
16
+ <svg class="qld__icon qld__promo-panel__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#{{metadata.promo_panel_icon.value}}"></use></svg>
17
+ {{else}}
18
+ <i class="qld__promo-panel__icon {{metadata.icon.value}}"></i>
19
+ {{/if}}
20
+ </div>
21
+ {{/ifCond}}
22
+
17
23
  {{#if metadata.title.value}}
18
24
  <h2 class="qld__display-xl">{{metadata.title.value}}</h2>
19
25
  {{/if}}
@@ -1,46 +1,31 @@
1
- (function () {
2
- "use strict";
1
+ /**
2
+ * @module initPromoPanel
3
+ */
3
4
 
4
- /**
5
- * @module initPromoPanel
6
- */
7
- var initPromoPanel = {};
5
+ export default function initPromoPanel(document = document) {
6
+ let promoPanels = document.querySelectorAll(".qld__promo-panel");
8
7
 
9
- /**
10
- * Initialise Promo Panel
11
- *
12
- * @memberof module:initPromoPanel
13
- */
14
- initPromoPanel.init = function () {
15
- let promoPanels = document.querySelectorAll(".qld__promo_panel");
8
+ if (promoPanels.length > 0) {
9
+ document.querySelectorAll("section").forEach(function (section) {
10
+ if (section.classList.contains("qld__promo-panel") && !section.classList.contains("qld__promo-panel--no-image")) {
11
+ let next = section.nextElementSibling;
16
12
 
17
- if (promoPanels.length > 0) {
18
- document.querySelectorAll("section").forEach(function (section) {
19
- if (section.classList.contains("qld__promo_panel") && !section.classList.contains("qld__promo_panel--no-image")) {
20
- let next = section.nextElementSibling;
21
-
22
- if (next && next.tagName.toLowerCase() === "data") {
23
- next = next.nextElementSibling;
24
- }
25
-
26
- if (next && next.classList.contains("qld__body--alt")) {
27
- section.classList.add("qld__body--alt-half");
28
- }
29
-
30
- if (next && next.classList.contains("qld__body--dark")) {
31
- section.classList.add("qld__body--dark-half");
32
- }
13
+ if (next && next.tagName.toLowerCase() === "data") {
14
+ next = next.nextElementSibling;
15
+ }
33
16
 
34
- if (next && next.classList.contains("qld__body--alt-dark")) {
35
- section.classList.add("qld__body--alt-dark-half");
36
- }
17
+ if (next && next.classList.contains("qld__body--alt")) {
18
+ section.classList.add("qld__body--alt-half");
37
19
  }
38
- });
39
- }
40
- };
41
20
 
42
- // Assign initPromoPanel to global QLD object of functions
43
- QLD.initPromoPanel = initPromoPanel;
21
+ if (next && next.classList.contains("qld__body--dark")) {
22
+ section.classList.add("qld__body--dark-half");
23
+ }
44
24
 
45
- document.addEventListener("DOMContentLoaded", initPromoPanel.init);
46
- })();
25
+ if (next && next.classList.contains("qld__body--alt-dark")) {
26
+ section.classList.add("qld__body--alt-dark-half");
27
+ }
28
+ }
29
+ });
30
+ }
31
+ }
@@ -63,6 +63,14 @@
63
63
  "required": false,
64
64
  "editable": true
65
65
  },
66
+ "promo_panel_icon": {
67
+ "type": "metadata_field_text",
68
+ "description": "",
69
+ "friendly_name": "Promo panel icon",
70
+ "value": "chevron-right",
71
+ "required": false,
72
+ "editable": true
73
+ },
66
74
  "title": {
67
75
  "type": "metadata_field_text",
68
76
  "description": "",
@@ -105,7 +105,7 @@
105
105
  border-left: 1px solid var(--QLD-color-light__border--alt);
106
106
  border-right: 1px solid var(--QLD-color-light__border--alt);
107
107
  border-top: 1px solid var(--QLD-color-light__border--alt);
108
- font-weight: 600;
108
+ font-weight: $QLD-font-weight-semibold;
109
109
  z-index: 1;
110
110
  text-decoration: none;
111
111
 
@@ -266,7 +266,7 @@
266
266
  border-left: 1px solid var(--QLD-color-dark__border--alt);
267
267
  border-right: 1px solid var(--QLD-color-dark__border--alt);
268
268
  border-top: 1px solid var(--QLD-color-dark__border--alt);
269
- font-weight: 600;
269
+ font-weight: $QLD-font-weight-semibold;
270
270
  z-index: 1;
271
271
  text-decoration: none;
272
272
  outline: none;
@@ -342,7 +342,7 @@
342
342
  border-left: 1px solid var(--QLD-color-dark__border--alt);
343
343
  border-right: 1px solid var(--QLD-color-dark__border--alt);
344
344
  border-top: 1px solid var(--QLD-color-dark__border--alt);
345
- font-weight: 600;
345
+ font-weight: $QLD-font-weight-semibold;
346
346
  z-index: 1;
347
347
  text-decoration: none;
348
348
  outline: none;
@@ -1,5 +1,5 @@
1
1
  .qld__toggle-tip {
2
2
  &-content {
3
- padding: #{map-get($QLD-space-map, 4)}px;
3
+ padding: 1rem;
4
4
  }
5
5
  }
@@ -1,5 +1,5 @@
1
1
  .qld__tool-tip {
2
2
  &-content {
3
- padding: 2px #{map-get($QLD-space-map, 2)}px 2px #{map-get($QLD-space-map, 2)}px;
3
+ padding: 0.125rem 0.5rem 0.125rem 0.5rem;
4
4
  }
5
5
  }
@@ -1,19 +1,22 @@
1
- (function () {
2
- 'use strict';
1
+ /**
2
+ * @module VideoPlayer
3
+ */
3
4
 
5
+ export default function initVideoPlayer(document = document) {
4
6
  // Select all accordion title buttons
5
- const accordionTitles = document.querySelectorAll('.qld__body qld__video__player--wrapper .qld__accordion__title');
6
-
7
+ const accordionTitles = document.querySelectorAll(".qld__body .qld__video__player--wrapper .qld__accordion__title");
7
8
  if (!accordionTitles.length) return;
8
9
 
9
- accordionTitles.forEach(function (accordionTitle) {
10
- accordionTitle.addEventListener('click', function () {
11
- // Toggle the text content based on the accordion state
12
- const buttonText = this.querySelector('i').nextSibling;
13
-
14
- buttonText.textContent = accordionTitle.classList.contains('qld__accordion--open')
15
- ? "Show transcript"
16
- : "Hide transcript";
10
+ accordionTitles.forEach((accordionTitle) => {
11
+ accordionTitle.addEventListener("click", () => {
12
+ toggleButtonState(accordionTitle);
17
13
  });
18
14
  });
19
- })();
15
+ }
16
+
17
+ function toggleButtonState(accordionTitle) {
18
+ // Toggle the text content based on the accordion state
19
+ const buttonSpan = accordionTitle.querySelector("svg").nextElementSibling;
20
+ const isCurrentlyOpen = accordionTitle.classList.contains("qld__accordion--open");
21
+ buttonSpan.textContent = isCurrentlyOpen ? "Show transcript" : "Hide transcript";
22
+ }