@worksafevictoria/wcl7.5 1.9.0-beta.3 → 1.9.0-beta.5

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  3. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  4. package/src/components/Common/CardGridItem/index.vue +6 -2
  5. package/src/components/Containers/Carousel/index.stories.js +2 -1
  6. package/src/components/Containers/Carousel/index.vue +68 -69
  7. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  8. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  9. package/src/components/Containers/HomepageHeaderNew/index.vue +0 -5
  10. package/src/components/Global/AppFooter/index.vue +115 -129
  11. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  12. package/src/components/Global/AppHeader/index.stories.js +2 -2
  13. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  14. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  15. package/src/components/Global/AppHeaderNew/index.vue +22 -22
  16. package/src/components/Global/BackToTop/index.vue +16 -16
  17. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  18. package/src/components/Global/HeroHeader/index.vue +62 -73
  19. package/src/components/Global/SocialShare/index.vue +62 -66
  20. package/src/components/Global/Strip/index.vue +9 -5
  21. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -23
  22. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  23. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  24. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  25. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  26. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -120
  27. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  28. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +158 -128
  29. package/src/components/Paragraphs/TabulatedData/index.vue +3 -2
  30. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  31. package/src/components/SubComponents/Icon/README.md +2 -2
  32. package/src/components/SubComponents/Icon/example.js +1 -0
  33. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  34. package/src/components/SubComponents/Icon/index.vue +47 -47
  35. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  36. package/src/components/SubComponents/Search/index.vue +4 -0
  37. package/src/components/SubComponents/VideoThumbnail/index.vue +30 -28
  38. package/src/mock/carousel-items.js +46 -81
@@ -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">
@@ -82,7 +82,7 @@
82
82
  <div class="app-header__close-button mobile-close">
83
83
  <button
84
84
  v-if="
85
- (isMobileMenuOpen && this.screen === 'mobile' && !isSecondLevelOpen)
85
+ (isMobileMenuOpen && screen === 'mobile' && !isSecondLevelOpen)
86
86
  "
87
87
  ref="closeMenuButton"
88
88
  class="dark"
@@ -94,17 +94,17 @@
94
94
  </div>
95
95
  <div
96
96
  v-if="
97
- (!isSecondLevelOpen && this.screen === 'desktop') ||
98
- (!isMobileMenuOpen && this.screen === 'mobile')
97
+ (!isSecondLevelOpen && screen === 'desktop') ||
98
+ (!isMobileMenuOpen && screen === 'mobile')
99
99
  "
100
100
  class="app-header__app-branding"
101
101
  >
102
102
 
103
103
  </div>
104
104
  <nav
105
- v-if="isMobileMenuOpen || this.screen === 'desktop'"
105
+ v-if="isMobileMenuOpen || screen === 'desktop'"
106
106
  :class="{
107
- 'styled-scrollbar': this.screen === 'mobile' && !isSecondLevelOpen,
107
+ 'styled-scrollbar': screen === 'mobile' && !isSecondLevelOpen,
108
108
  }"
109
109
  >
110
110
  <ul class="app-header__nav-menu" id="navitems">
@@ -128,7 +128,7 @@
128
128
  >
129
129
  <span>{{ firstLevelLink.title }}</span>
130
130
 
131
- <caret-down v-if="this.screen === 'desktop'" class="caret-down" />
131
+ <caret-down v-if="screen === 'desktop'" class="caret-down" />
132
132
  <caret-right
133
133
  v-else-if="!isSecondLevelOpen && !isThirdLevelOpen"
134
134
  class="caret-right"
@@ -153,7 +153,7 @@
153
153
  <div v-if="isSecondLevelOpen" class="sub-nav-container">
154
154
  <div class="app-header__close-button">
155
155
  <button
156
- v-if="this.screen === 'mobile'"
156
+ v-if="screen === 'mobile'"
157
157
  ref="menuBackButton"
158
158
  class="dark"
159
159
  @click="mobileGoBack"
@@ -164,8 +164,8 @@
164
164
  </button>
165
165
  <button
166
166
  v-if="
167
- (isSecondLevelOpen && this.screen === 'desktop') ||
168
- (isMobileMenuOpen && this.screen === 'mobile')
167
+ (isSecondLevelOpen && screen === 'desktop') ||
168
+ (isMobileMenuOpen && screen === 'mobile')
169
169
  "
170
170
  ref="closeMenuButton"
171
171
  class="dark"
@@ -177,13 +177,13 @@
177
177
  </div>
178
178
  <div
179
179
  class="sub-nav-container__inner"
180
- :class="{ 'styled-scrollbar': this.screen === 'desktop' }"
180
+ :class="{ 'styled-scrollbar': screen === 'desktop' }"
181
181
  >
182
182
  <div
183
183
  class="sub-nav-container__wrap"
184
184
  :class="{
185
185
  'styled-scrollbar':
186
- this.screen === 'mobile' && isSecondLevelOpen,
186
+ screen === 'mobile' && isSecondLevelOpen,
187
187
  }"
188
188
  >
189
189
  <div
@@ -227,7 +227,7 @@
227
227
  >
228
228
  <span>{{ secondLevelLink.title }}</span>
229
229
  <caret-right
230
- v-if="!(this.screen === 'mobile' && isThirdLevelOpen)"
230
+ v-if="!(screen === 'mobile' && isThirdLevelOpen)"
231
231
  class="caret-right"
232
232
  />
233
233
  </a>
@@ -313,7 +313,7 @@
313
313
 
314
314
  <!-- More action button in bottom menu -->
315
315
 
316
- <li class="nav-item" id="moreDesktop" v-if="this.screen === 'desktop' && this.moreList.length > 0">
316
+ <li class="nav-item" id="moreDesktop" v-if="screen === 'desktop' && this.moreList.length > 0">
317
317
  <a class="dark" role="button" @click="showMore = !showMore">
318
318
  <span>More</span>
319
319
  <caret-down class="caret-down" style="padding-top: 4px; height: 16px; width: 16px"/>
@@ -374,7 +374,7 @@
374
374
  <div v-if="isSecondLevelOpen" class="sub-nav-container">
375
375
  <div class="app-header__close-button">
376
376
  <button
377
- v-if="this.screen === 'mobile'"
377
+ v-if="screen === 'mobile'"
378
378
  ref="menuBackButton"
379
379
  class="dark"
380
380
  @click="mobileGoBack"
@@ -385,8 +385,8 @@
385
385
  </button>
386
386
  <button
387
387
  v-if="
388
- (isSecondLevelOpen && this.screen === 'desktop') ||
389
- (isMobileMenuOpen && this.screen === 'mobile')
388
+ (isSecondLevelOpen && screen === 'desktop') ||
389
+ (isMobileMenuOpen && screen === 'mobile')
390
390
  "
391
391
  ref="closeMenuButton"
392
392
  class="dark"
@@ -398,11 +398,11 @@
398
398
  </div>
399
399
  <div
400
400
  class="sub-nav-container__inner"
401
- :class="{ 'styled-scrollbar': this.screen === 'desktop' }"
401
+ :class="{ 'styled-scrollbar': screen === 'desktop' }"
402
402
  >
403
403
  <div
404
404
  class="sub-nav-container__wrap"
405
- :class="{'styled-scrollbar': this.screen === 'mobile' && isSecondLevelOpen,}"
405
+ :class="{'styled-scrollbar': screen === 'mobile' && isSecondLevelOpen,}"
406
406
  >
407
407
  <div
408
408
  class="selected-title"
@@ -445,7 +445,7 @@
445
445
  >
446
446
  <span>{{ secondLevelLink.title }}</span>
447
447
  <caret-right
448
- v-if="!(this.screen === 'mobile' && isThirdLevelOpen)"
448
+ v-if="!(screen === 'mobile' && isThirdLevelOpen)"
449
449
  class="caret-right"
450
450
  />
451
451
  </a>
@@ -535,14 +535,14 @@
535
535
 
536
536
  </div>
537
537
  </li>
538
- <li v-if="isWorkWell && this.screen === 'desktop'" class="nav-item hide">
538
+ <li v-if="isWorkWell && screen === 'desktop'" class="nav-item hide">
539
539
  <a href="#" class="dark" @focus="resetTab"></a>
540
540
  </li>
541
541
  </ul>
542
542
 
543
543
 
544
544
  </nav>
545
- <div v-if="this.screen === 'mobile'" class="app-header__mobile-menu-container">
545
+ <div v-if="screen === 'mobile'" class="app-header__mobile-menu-container">
546
546
  <ul id="mobileitems">
547
547
  <li v-if="!isMobileMenuOpen">
548
548
  <a class="dark" role="button" @click.prevent="showMobileMenu">
@@ -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>
@@ -12,14 +12,8 @@
12
12
  : false
13
13
  "
14
14
  >
15
- <row
16
- v-if="type === 'hero'"
17
- class="wcl-hero-header__wrap wcl-hero-header__showmore"
18
- >
19
- <container
20
- class="wcl-hero-header__content-wrapper__content"
21
- :class="{ rtl }"
22
- >
15
+ <row v-if="type === 'hero'" class="wcl-hero-header__wrap wcl-hero-header__showmore">
16
+ <container class="wcl-hero-header__content-wrapper__content" :class="{ rtl }">
23
17
  <row>
24
18
  <column class="wcl-hero-header__content-wrapper__content-col">
25
19
  <div>
@@ -28,7 +22,12 @@
28
22
  class="btn btn-link wcl-hero-header__showmore--link"
29
23
  @click="showMore"
30
24
  >
31
- <icon width="16px" height="10.61px" :glyph="CaretDown" />
25
+ <icon
26
+ width="16px"
27
+ height="10.61px"
28
+ :glyph="CaretDown"
29
+ icon-alt="expand icon"
30
+ />
32
31
  <span class="wcl-hero-header__showmore--text">Show more</span>
33
32
  </button>
34
33
  </div>
@@ -38,18 +37,14 @@
38
37
  </row>
39
38
  <row class="wcl-hero-header__wrap">
40
39
  <div class="wcl-hero-header__content-wrapper">
41
- <container
42
- class="wcl-hero-header__content-wrapper__content"
43
- :class="{ rtl }"
44
- >
40
+ <container class="wcl-hero-header__content-wrapper__content" :class="{ rtl }">
45
41
  <row>
46
42
  <column
47
43
  :xs="generateGridValue(type)"
48
44
  class="wcl-hero-header__content-wrapper__content-col"
49
45
  :md="7"
50
46
  :class="{
51
- [`wcl-hero-header__content-wrapper__content-col--split`]:
52
- $slots.side,
47
+ [`wcl-hero-header__content-wrapper__content-col--split`]: $slots.side,
53
48
  }"
54
49
  >
55
50
  <breadcrumb
@@ -64,10 +59,7 @@
64
59
  :content="strippedTitle"
65
60
  class="wcl-hero-header__title"
66
61
  />
67
- <div
68
- v-if="subTitle || $slots.description"
69
- class="header-rich-text-wrap"
70
- >
62
+ <div v-if="subTitle || $slots.description" class="header-rich-text-wrap">
71
63
  <rich-text
72
64
  v-if="subTitle"
73
65
  :content="subTitle"
@@ -120,9 +112,7 @@
120
112
  <column
121
113
  v-if="type === 'collection' && showMask"
122
114
  :sm="'7'"
123
- :style="
124
- image && image.url ? `background-image:url(${image.url})` : false
125
- "
115
+ :style="image && image.url ? `background-image:url(${image.url})` : false"
126
116
  class="wcl-hero-header__right type-collection"
127
117
  :class="{ 'rtl-flip': rtl }"
128
118
  :offset-sm="rtl ? 0 : 5"
@@ -131,6 +121,7 @@
131
121
  <img
132
122
  src="../../../assets/images/hero-header-mask.png"
133
123
  role="presentation"
124
+ alt="hero header mask"
134
125
  />
135
126
  </div>
136
127
  </column>
@@ -143,9 +134,7 @@
143
134
  :class="{ 'rtl-flip': rtl }"
144
135
  :offset-md="rtl ? 0 : 7"
145
136
  :offset-xs="rtl ? 0 : 7"
146
- :style="
147
- image && image.url ? `background-image:url(${image.url})` : false
148
- "
137
+ :style="image && image.url ? `background-image:url(${image.url})` : false"
149
138
  >
150
139
  &nbsp;
151
140
  </column>
@@ -155,19 +144,19 @@
155
144
  </container>
156
145
  </template>
157
146
  <script>
158
- import SocialShare from './../SocialShare/index.vue'
159
- import Container from './../../Containers/Container/index.vue'
160
- import Row from './../../Containers/Row/index.vue'
161
- import Column from './../../Containers/Column/index.vue'
162
- import Breadcrumb from './../../SubComponents/Breadcrumb/index.vue'
163
- import CtaButton from './../../SubComponents/CtaButton/index.vue'
164
- import Icon from './../../SubComponents/Icon/index.vue'
165
- import HeroHeaderChevron from './../../../assets/images/hero-header-chevron.svg?component'
166
- import CaretDown from './../../../assets/icons/chev-down-white.svg?url'
167
- import RichText from './../../Paragraphs/RichText/index.vue'
147
+ import SocialShare from "./../SocialShare/index.vue";
148
+ import Container from "./../../Containers/Container/index.vue";
149
+ import Row from "./../../Containers/Row/index.vue";
150
+ import Column from "./../../Containers/Column/index.vue";
151
+ import Breadcrumb from "./../../SubComponents/Breadcrumb/index.vue";
152
+ import CtaButton from "./../../SubComponents/CtaButton/index.vue";
153
+ import Icon from "./../../SubComponents/Icon/index.vue";
154
+ import HeroHeaderChevron from "./../../../assets/images/hero-header-chevron.svg?component";
155
+ import CaretDown from "./../../../assets/icons/chev-down-white.svg?url";
156
+ import RichText from "./../../Paragraphs/RichText/index.vue";
168
157
 
169
158
  export default {
170
- name: 'HeroHeader',
159
+ name: "HeroHeader",
171
160
  components: {
172
161
  Container,
173
162
  Row,
@@ -182,15 +171,15 @@ export default {
182
171
  props: {
183
172
  type: {
184
173
  type: String,
185
- default: 'default',
174
+ default: "default",
186
175
  },
187
176
  title: {
188
177
  type: String,
189
- default: '',
178
+ default: "",
190
179
  },
191
180
  description: {
192
181
  type: String,
193
- default: '',
182
+ default: "",
194
183
  },
195
184
  image: {
196
185
  type: Object,
@@ -234,33 +223,33 @@ export default {
234
223
  socialShareToggle: false,
235
224
  HeroHeaderChevron,
236
225
  CaretDown,
237
- }
226
+ };
238
227
  },
239
228
  computed: {
240
229
  generatedClass() {
241
- let c = `wcl-hero-header type-${this.type}`
230
+ let c = `wcl-hero-header type-${this.type}`;
242
231
  if (this.bgColor) {
243
- c = c + ' -with-bg'
232
+ c = c + " -with-bg";
244
233
  }
245
- return c
234
+ return c;
246
235
  },
247
236
  subTitle() {
248
- let content = undefined
237
+ let content = undefined;
249
238
  if (this.description) {
250
- if (typeof this.description === 'string') {
251
- content = this.description
252
- } else if (typeof this.description === 'object') {
253
- content = this.description.processed
239
+ if (typeof this.description === "string") {
240
+ content = this.description;
241
+ } else if (typeof this.description === "object") {
242
+ content = this.description.processed;
254
243
  }
255
244
  }
256
- if (content && !content.startsWith('<') && !this.tag?.startsWith('h')) {
257
- content = `<p class="intro">${content}</p>`
245
+ if (content && !content.startsWith("<") && !this.tag?.startsWith("h")) {
246
+ content = `<p class="intro">${content}</p>`;
258
247
  }
259
- return content
248
+ return content;
260
249
  },
261
250
  strippedTitle() {
262
- if (this.type === 'hero' && this.title.length > 122) {
263
- return this.title.slice(0, 122) + '...'
251
+ if (this.type === "hero" && this.title.length > 122) {
252
+ return this.title.slice(0, 122) + "...";
264
253
  }
265
254
  // Will reintroduce if business requirement
266
255
  // if (this.title?.includes('.')) {
@@ -269,7 +258,7 @@ export default {
269
258
  // return sentences.map((sentence) => sentence.trim()).join('.<br/>')
270
259
  // }
271
260
  // }
272
- return this.title
261
+ return this.title;
273
262
  },
274
263
  // Will reintroduce if business requirement
275
264
  // strippedDescription() {
@@ -282,57 +271,57 @@ export default {
282
271
  },
283
272
  mounted() {
284
273
  if (this.$bus) {
285
- this.$bus.$on('scrollToTop', () => {
274
+ this.$bus.$on("scrollToTop", () => {
286
275
  setTimeout(() => {
287
- const title = this.$refs.title
276
+ const title = this.$refs.title;
288
277
  if (title) {
289
- title.$el.setAttribute('tabindex', 0)
290
- title.$el.focus()
278
+ title.$el.setAttribute("tabindex", 0);
279
+ title.$el.focus();
291
280
  }
292
- }, 500)
293
- })
281
+ }, 500);
282
+ });
294
283
  }
295
284
  },
296
285
  beforeDestroy() {
297
286
  if (this.$bus) {
298
- this.$bus.$off('scrollToTop')
287
+ this.$bus.$off("scrollToTop");
299
288
  }
300
289
  },
301
290
  methods: {
302
291
  generateGridValue(type) {
303
292
  switch (type) {
304
293
  //the prop type default
305
- case 'default':
306
- return '6'
307
- case 'image':
308
- return '6'
294
+ case "default":
295
+ return "6";
296
+ case "image":
297
+ return "6";
309
298
  default:
310
- return '7'
299
+ return "7";
311
300
  }
312
301
  },
313
302
  showMore(ev) {
314
303
  if (ev?.target?.scrollIntoView) {
315
304
  ev.target.scrollIntoView({
316
- behavior: 'smooth',
305
+ behavior: "smooth",
317
306
  alignToTop: true,
318
- block: 'start',
319
- })
307
+ block: "start",
308
+ });
320
309
  }
321
310
  },
322
311
  fireGTM() {
323
312
  let attrs = {
324
313
  label: this.cta.uri,
325
314
  document_title: this.cta.filename,
326
- }
315
+ };
327
316
  if (this.$gtm) {
328
- this.$gtm.push({ event: 'custom.interaction.download', ...attrs })
317
+ this.$gtm.push({ event: "custom.interaction.download", ...attrs });
329
318
  }
330
319
  },
331
320
  },
332
- }
321
+ };
333
322
  </script>
334
323
  <style lang="scss" scoped>
335
- @import './styles';
324
+ @import "./styles";
336
325
 
337
326
  .wysiwyg {
338
327
  :deep(.cta-button:last-child) {