@worksafevictoria/wcl7.5 1.9.0 → 1.11.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 (42) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/package.json +1 -1
  3. package/src/assets/styles/generated-icons.scss +46 -46
  4. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  5. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +29 -32
  6. package/src/components/Common/CardGridItem/index.vue +8 -2
  7. package/src/components/Containers/Carousel/index.stories.js +6 -4
  8. package/src/components/Containers/Carousel/index.vue +131 -120
  9. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  10. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  11. package/src/components/Containers/HomepageHeaderNew/index.vue +3 -7
  12. package/src/components/Global/AppFooter/index.vue +130 -137
  13. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  14. package/src/components/Global/AppHeader/index.stories.js +2 -2
  15. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  16. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  17. package/src/components/Global/AppHeaderNew/index.vue +53 -24
  18. package/src/components/Global/AppHeaderNew/styles.scss +1 -4
  19. package/src/components/Global/BackToTop/index.vue +16 -16
  20. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  21. package/src/components/Global/HeroHeader/index.vue +62 -73
  22. package/src/components/Global/SocialShare/index.vue +114 -129
  23. package/src/components/Global/Strip/index.vue +82 -70
  24. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +22 -24
  25. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  26. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  27. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  28. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  29. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -120
  30. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  31. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +158 -128
  32. package/src/components/Paragraphs/Tabs/index.vue +4 -4
  33. package/src/components/Paragraphs/TabulatedData/index.vue +21 -20
  34. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  35. package/src/components/SubComponents/Icon/README.md +2 -2
  36. package/src/components/SubComponents/Icon/example.js +1 -0
  37. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  38. package/src/components/SubComponents/Icon/index.vue +47 -47
  39. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  40. package/src/components/SubComponents/Search/index.vue +4 -0
  41. package/src/components/SubComponents/VideoThumbnail/index.vue +8 -6
  42. package/src/mock/carousel-items.js +46 -81
@@ -7,12 +7,16 @@
7
7
  @click="$emit('closed')"
8
8
  >
9
9
  Close menu
10
- <img class="app-search__close-icon" width="22" height="18" :src="Close" />
10
+ <img
11
+ class="app-search__close-icon"
12
+ width="22"
13
+ height="18"
14
+ :src="Close"
15
+ alt="search close icon"
16
+ />
11
17
  </button>
12
18
  <form @submit.prevent>
13
- <label
14
- class="app-search__label font-weight-bold"
15
- for="app-search--search-input-box"
19
+ <label class="app-search__label font-weight-bold" for="app-search--search-input-box"
16
20
  >Search WorkSafe</label
17
21
  >
18
22
  <search
@@ -32,40 +36,40 @@
32
36
  </template>
33
37
 
34
38
  <script>
35
- import Close from '../../../../assets/icons/close.svg?url'
36
- import Search from '../../../SubComponents/Search/index.vue'
39
+ import Close from "../../../../assets/icons/close.svg?url";
40
+ import Search from "../../../SubComponents/Search/index.vue";
37
41
 
38
42
  export default {
39
- name: 'ModalSearch',
43
+ name: "ModalSearch",
40
44
  components: { Search },
41
45
  props: {
42
46
  searchQuery: {
43
47
  type: String,
44
- default: ''
48
+ default: "",
45
49
  },
46
50
  contentParser: {
47
51
  type: Function,
48
- required: true
52
+ required: true,
49
53
  },
50
54
  googleSearchFlag: {
51
55
  type: String,
52
- default: 'googlerest'
53
- }
56
+ default: "googlerest",
57
+ },
54
58
  },
55
59
  data() {
56
60
  return {
57
61
  pageLimit: 20,
58
62
  pageNumber: 1,
59
63
  searchResults: null,
60
- Close
61
- }
64
+ Close,
65
+ };
62
66
  },
63
67
  mounted() {
64
- this.$refs.searchInputBox.$el.querySelector('input').focus()
65
- }
66
- }
68
+ this.$refs.searchInputBox.$el.querySelector("input").focus();
69
+ },
70
+ };
67
71
  </script>
68
72
 
69
73
  <style lang="scss" scoped>
70
- @import './styles';
74
+ @import "./styles";
71
75
  </style>
@@ -16,7 +16,7 @@ const contentParser = () => {
16
16
 
17
17
 
18
18
  export default {
19
- title: 'Website_Redesign/AppHeader',
19
+ title: 'Global/AppHeader',
20
20
  component: AppHeader,
21
21
  tags: ['autodocs'],
22
22
  data() {
@@ -71,4 +71,4 @@ const DefaultContent = (args) => ({
71
71
  `
72
72
  })
73
73
 
74
- export const Default = DefaultContent.bind({})
74
+ export const New = DefaultContent.bind({})
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <header
4
4
  v-if="headerMenu"
5
- :class="'app-header' + (this.screen === 'mobile' ? ' ' + 'isMobile' : '')"
5
+ :class="'app-header' + (screen === 'mobile' ? ' ' + 'isMobile' : '')"
6
6
  >
7
7
  <!-- Top menu -->
8
8
  <div class="logo">
@@ -33,10 +33,11 @@
33
33
  </nuxt-link>
34
34
  </td>
35
35
  <td>
36
- <a href="javascript:void(0)" @click="show = !show" title="Contrast">
37
- <span v-if="!topLevelIconsOnly">Adjust control</span> <img alt="Contrast Icon" width="20px" height="20px" :src=ContrastIcon />
36
+ <a href="javascript:void(0)" @click="show = !show" @keyup.esc="show = !show" title="Contrast" ref="selectContrast">
37
+ <span v-if="!topLevelIconsOnly">Adjust contrast</span> <img alt="Contrast Icon" width="20px" height="20px" :src=ContrastIcon />
38
38
  </a>
39
39
  <div
40
+ ref="contrastChoices"
40
41
  class="flex-container"
41
42
  v-if="show"
42
43
  >
@@ -82,7 +83,7 @@
82
83
  <div class="app-header__close-button mobile-close">
83
84
  <button
84
85
  v-if="
85
- (isMobileMenuOpen && this.screen === 'mobile' && !isSecondLevelOpen)
86
+ (isMobileMenuOpen && screen === 'mobile' && !isSecondLevelOpen)
86
87
  "
87
88
  ref="closeMenuButton"
88
89
  class="dark"
@@ -94,17 +95,17 @@
94
95
  </div>
95
96
  <div
96
97
  v-if="
97
- (!isSecondLevelOpen && this.screen === 'desktop') ||
98
- (!isMobileMenuOpen && this.screen === 'mobile')
98
+ (!isSecondLevelOpen && screen === 'desktop') ||
99
+ (!isMobileMenuOpen && screen === 'mobile')
99
100
  "
100
101
  class="app-header__app-branding"
101
102
  >
102
103
 
103
104
  </div>
104
105
  <nav
105
- v-if="isMobileMenuOpen || this.screen === 'desktop'"
106
+ v-if="isMobileMenuOpen || screen === 'desktop'"
106
107
  :class="{
107
- 'styled-scrollbar': this.screen === 'mobile' && !isSecondLevelOpen,
108
+ 'styled-scrollbar': screen === 'mobile' && !isSecondLevelOpen,
108
109
  }"
109
110
  >
110
111
  <ul class="app-header__nav-menu" id="navitems">
@@ -128,7 +129,7 @@
128
129
  >
129
130
  <span>{{ firstLevelLink.title }}</span>
130
131
 
131
- <caret-down v-if="this.screen === 'desktop'" class="caret-down" />
132
+ <caret-down v-if="screen === 'desktop'" class="caret-down" />
132
133
  <caret-right
133
134
  v-else-if="!isSecondLevelOpen && !isThirdLevelOpen"
134
135
  class="caret-right"
@@ -153,7 +154,7 @@
153
154
  <div v-if="isSecondLevelOpen" class="sub-nav-container">
154
155
  <div class="app-header__close-button">
155
156
  <button
156
- v-if="this.screen === 'mobile'"
157
+ v-if="screen === 'mobile'"
157
158
  ref="menuBackButton"
158
159
  class="dark"
159
160
  @click="mobileGoBack"
@@ -164,8 +165,8 @@
164
165
  </button>
165
166
  <button
166
167
  v-if="
167
- (isSecondLevelOpen && this.screen === 'desktop') ||
168
- (isMobileMenuOpen && this.screen === 'mobile')
168
+ (isSecondLevelOpen && screen === 'desktop') ||
169
+ (isMobileMenuOpen && screen === 'mobile')
169
170
  "
170
171
  ref="closeMenuButton"
171
172
  class="dark"
@@ -177,13 +178,13 @@
177
178
  </div>
178
179
  <div
179
180
  class="sub-nav-container__inner"
180
- :class="{ 'styled-scrollbar': this.screen === 'desktop' }"
181
+ :class="{ 'styled-scrollbar': screen === 'desktop' }"
181
182
  >
182
183
  <div
183
184
  class="sub-nav-container__wrap"
184
185
  :class="{
185
186
  'styled-scrollbar':
186
- this.screen === 'mobile' && isSecondLevelOpen,
187
+ screen === 'mobile' && isSecondLevelOpen,
187
188
  }"
188
189
  >
189
190
  <div
@@ -227,7 +228,7 @@
227
228
  >
228
229
  <span>{{ secondLevelLink.title }}</span>
229
230
  <caret-right
230
- v-if="!(this.screen === 'mobile' && isThirdLevelOpen)"
231
+ v-if="!(screen === 'mobile' && isThirdLevelOpen)"
231
232
  class="caret-right"
232
233
  />
233
234
  </a>
@@ -313,7 +314,7 @@
313
314
 
314
315
  <!-- More action button in bottom menu -->
315
316
 
316
- <li class="nav-item" id="moreDesktop" v-if="this.screen === 'desktop' && this.moreList.length > 0">
317
+ <li class="nav-item" id="moreDesktop" v-if="screen === 'desktop' && this.moreList.length > 0">
317
318
  <a class="dark" role="button" @click="showMore = !showMore">
318
319
  <span>More</span>
319
320
  <caret-down class="caret-down" style="padding-top: 4px; height: 16px; width: 16px"/>
@@ -374,7 +375,7 @@
374
375
  <div v-if="isSecondLevelOpen" class="sub-nav-container">
375
376
  <div class="app-header__close-button">
376
377
  <button
377
- v-if="this.screen === 'mobile'"
378
+ v-if="screen === 'mobile'"
378
379
  ref="menuBackButton"
379
380
  class="dark"
380
381
  @click="mobileGoBack"
@@ -385,8 +386,8 @@
385
386
  </button>
386
387
  <button
387
388
  v-if="
388
- (isSecondLevelOpen && this.screen === 'desktop') ||
389
- (isMobileMenuOpen && this.screen === 'mobile')
389
+ (isSecondLevelOpen && screen === 'desktop') ||
390
+ (isMobileMenuOpen && screen === 'mobile')
390
391
  "
391
392
  ref="closeMenuButton"
392
393
  class="dark"
@@ -398,11 +399,11 @@
398
399
  </div>
399
400
  <div
400
401
  class="sub-nav-container__inner"
401
- :class="{ 'styled-scrollbar': this.screen === 'desktop' }"
402
+ :class="{ 'styled-scrollbar': screen === 'desktop' }"
402
403
  >
403
404
  <div
404
405
  class="sub-nav-container__wrap"
405
- :class="{'styled-scrollbar': this.screen === 'mobile' && isSecondLevelOpen,}"
406
+ :class="{'styled-scrollbar': screen === 'mobile' && isSecondLevelOpen,}"
406
407
  >
407
408
  <div
408
409
  class="selected-title"
@@ -445,7 +446,7 @@
445
446
  >
446
447
  <span>{{ secondLevelLink.title }}</span>
447
448
  <caret-right
448
- v-if="!(this.screen === 'mobile' && isThirdLevelOpen)"
449
+ v-if="!(screen === 'mobile' && isThirdLevelOpen)"
449
450
  class="caret-right"
450
451
  />
451
452
  </a>
@@ -535,14 +536,14 @@
535
536
 
536
537
  </div>
537
538
  </li>
538
- <li v-if="isWorkWell && this.screen === 'desktop'" class="nav-item hide">
539
+ <li v-if="isWorkWell && screen === 'desktop'" class="nav-item hide">
539
540
  <a href="#" class="dark" @focus="resetTab"></a>
540
541
  </li>
541
542
  </ul>
542
543
 
543
544
 
544
545
  </nav>
545
- <div v-if="this.screen === 'mobile'" class="app-header__mobile-menu-container">
546
+ <div v-if="screen === 'mobile'" class="app-header__mobile-menu-container">
546
547
  <ul id="mobileitems">
547
548
  <li v-if="!isMobileMenuOpen">
548
549
  <a class="dark" role="button" @click.prevent="showMobileMenu">
@@ -661,6 +662,9 @@ export default {
661
662
  selectedValue: null
662
663
  }
663
664
  },
665
+
666
+ emits: ['handleContrast'],
667
+
664
668
  computed: {
665
669
  showSecondLevelCaret() {
666
670
  return (
@@ -709,6 +713,16 @@ export default {
709
713
  window.addEventListener('resize', this.updateMoreMenu())
710
714
  })
711
715
  this.updateMoreMenu()
716
+ let selectedMode = document
717
+ .getElementById('contrastStyle')
718
+ ?.getAttribute('data-sel')
719
+ this.selectedValue = selectedMode ?? 'default'
720
+ window.addEventListener('click', this.handleOutsideClick)
721
+ window.addEventListener('scroll', this.resetContrast)
722
+ },
723
+ beforeDestroy() {
724
+ window.removeEventListener('click', this.handleOutsideClick)
725
+ window.removeEventListener('scroll', this.resetContrast)
712
726
  },
713
727
  destroyed() {
714
728
  window.removeEventListener('resize', this.screenWidth),
@@ -1112,8 +1126,18 @@ export default {
1112
1126
  goToLocation(path) {
1113
1127
  this.$router.push(path)
1114
1128
  },
1129
+ handleOutsideClick(event) {
1130
+ const contentChoices = this.$refs.contrastChoices
1131
+ const contentSelect = this.$refs.selectContrast
1132
+
1133
+ // Check if the click is outside the content - both radios and Adjust contrast link
1134
+ if ((contentChoices && !contentChoices.contains(event.target)) && (contentSelect && !contentSelect.contains(event.target))) {
1135
+ this.show = !this.show
1136
+ }
1137
+ },
1115
1138
  handleContrast(event) {
1116
1139
  const selMode = event.target.value
1140
+ this.selectedValue = selMode
1117
1141
  // the css we are going to inject
1118
1142
  let cssVar = ''
1119
1143
  if (selMode === 'high_contrast') {
@@ -1165,6 +1189,11 @@ export default {
1165
1189
  style.setAttribute('data-sel', selMode) // Set a data attribute on the style element
1166
1190
  // panel collapsing after making selection
1167
1191
  this.show = !this.show
1192
+ },
1193
+ resetContrast() {
1194
+ if (this.show) {
1195
+ this.show = !this.show
1196
+ }
1168
1197
  }
1169
1198
  },
1170
1199
  }
@@ -246,10 +246,7 @@
246
246
 
247
247
  &:last-of-type {
248
248
  > a {
249
- svg {
250
- height: 23px;
251
- width: 23px;
252
- }
249
+
253
250
  & > span {
254
251
  margin-right: 10px;
255
252
  @media screen and (max-width: 1010px) and (min-width: 981px) {
@@ -3,19 +3,19 @@
3
3
  <button class="btbButton" @click="backToTop">
4
4
  <span>Back to top</span>
5
5
  <span class="btbButton--iconContainer">
6
- <icon :glyph="ChevUp" :width="24" :height="16" />
6
+ <icon :glyph="ChevUp" :width="24" :height="16" icon-alt="Back to top icon" />
7
7
  </span>
8
8
  </button>
9
9
  </div>
10
10
  </template>
11
11
 
12
12
  <script>
13
- import Icon from '../../SubComponents/Icon/index.vue'
14
- import ChevUp from '../../../assets/icons/chev-up.svg?raw'
15
- import { debounce } from 'lodash-es'
13
+ import Icon from "../../SubComponents/Icon/index.vue";
14
+ import ChevUp from "../../../assets/icons/chev-up.svg?raw";
15
+ import { debounce } from "lodash-es";
16
16
 
17
17
  export default {
18
- name: 'BackToTop',
18
+ name: "BackToTop",
19
19
  components: {
20
20
  Icon,
21
21
  },
@@ -29,39 +29,39 @@ export default {
29
29
  return {
30
30
  ChevUp,
31
31
  showBackToTop: false,
32
- }
32
+ };
33
33
  },
34
34
  computed: {
35
35
  showButton() {
36
36
  if (this.storybook) {
37
- return true
37
+ return true;
38
38
  } else {
39
- return this.showBackToTop
39
+ return this.showBackToTop;
40
40
  }
41
41
  },
42
42
  },
43
43
  mounted() {
44
- this.handleDebouncedScroll = debounce(this.showHideBtbBtn, 100)
45
- window.addEventListener('scroll', this.showHideBtbBtn)
44
+ this.handleDebouncedScroll = debounce(this.showHideBtbBtn, 100);
45
+ window.addEventListener("scroll", this.showHideBtbBtn);
46
46
  },
47
47
  beforeDestroy() {
48
- window.removeEventListener('scroll', this.showHideBtbBtn)
48
+ window.removeEventListener("scroll", this.showHideBtbBtn);
49
49
  },
50
50
  methods: {
51
51
  backToTop() {
52
52
  if (!this.storybook) {
53
- window.scrollTo(0, 0)
53
+ window.scrollTo(0, 0);
54
54
  } else {
55
- console.log('Is storybook, so not going back to top')
55
+ console.log("Is storybook, so not going back to top");
56
56
  }
57
57
  },
58
58
  showHideBtbBtn() {
59
- this.showBackToTop = window.scrollY > window.innerHeight / 2
59
+ this.showBackToTop = window.scrollY > window.innerHeight / 2;
60
60
  },
61
61
  },
62
- }
62
+ };
63
63
  </script>
64
64
 
65
65
  <style lang="scss" scoped>
66
- @import './styles.scss';
66
+ @import "./styles.scss";
67
67
  </style>
@@ -20,7 +20,7 @@ export default {
20
20
  <br>
21
21
  <h2>Image</h2>
22
22
  <p>This is an image</p>
23
- <img src='https://picsum.photos/900/600/?image=26' width="400" height="200"/>
23
+ <img src='https://picsum.photos/900/600/?image=26' alt="photo image" width="400" height="200"/>
24
24
  <br>
25
25
  <br>
26
26
  <h2>Background Image</h2>