@worksafevictoria/wcl7.5 1.9.0-beta.1 → 1.9.0-beta.11

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 (41) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/package.json +1 -1
  3. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  4. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +29 -32
  5. package/src/components/Common/CardGridItem/index.vue +6 -2
  6. package/src/components/Containers/Carousel/index.stories.js +6 -4
  7. package/src/components/Containers/Carousel/index.vue +131 -120
  8. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  9. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  10. package/src/components/Containers/HomepageHeaderNew/index.vue +3 -7
  11. package/src/components/Global/AppFooter/index.vue +130 -133
  12. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  13. package/src/components/Global/AppHeader/index.stories.js +2 -2
  14. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  15. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  16. package/src/components/Global/AppHeaderNew/index.vue +53 -24
  17. package/src/components/Global/AppHeaderNew/styles.scss +1 -4
  18. package/src/components/Global/BackToTop/index.vue +16 -16
  19. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  20. package/src/components/Global/HeroHeader/index.vue +62 -73
  21. package/src/components/Global/SocialShare/index.vue +62 -66
  22. package/src/components/Global/Strip/index.vue +82 -70
  23. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -23
  24. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  25. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  26. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  27. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  28. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -120
  29. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  30. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +158 -128
  31. package/src/components/Paragraphs/TabulatedData/index.vue +3 -2
  32. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  33. package/src/components/SubComponents/Icon/README.md +2 -2
  34. package/src/components/SubComponents/Icon/example.js +1 -0
  35. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  36. package/src/components/SubComponents/Icon/index.vue +47 -47
  37. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  38. package/src/components/SubComponents/Search/index.vue +4 -0
  39. package/src/components/SubComponents/VideoThumbnail/index.vue +29 -28
  40. package/src/index.js +2 -2
  41. package/src/mock/carousel-items.js +46 -81
@@ -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) {
@@ -14,17 +14,13 @@
14
14
  class="social-share__button"
15
15
  >
16
16
  <div class="social-share__circle--black">
17
- <a
18
- tabindex="0"
19
- class="social-share__anchor"
20
- :href="`mailto:?body=${url}`"
21
- >
17
+ <a tabindex="0" class="social-share__anchor" :href="`mailto:?body=${url}`">
22
18
  <span class="visually-hidden">Email</span>
23
19
  <img
24
20
  role="presentation"
25
21
  class="social-share__img"
26
22
  :src="emailIcon"
27
- alt=""
23
+ alt="social share email icon"
28
24
  />
29
25
  </a></div
30
26
  ></b-button>
@@ -45,7 +41,7 @@
45
41
  role="presentation"
46
42
  class="social-share__img"
47
43
  :src="facebookIcon"
48
- alt=""
44
+ alt="social share facebook icon"
49
45
  />
50
46
  </a></div
51
47
  ></b-button>
@@ -66,7 +62,7 @@
66
62
  role="presentation"
67
63
  class="social-share__img"
68
64
  :src="twitterIcon"
69
- alt=""
65
+ alt="social share twitter icon"
70
66
  />
71
67
  </a></div
72
68
  ></b-button>
@@ -86,7 +82,7 @@
86
82
  role="presentation"
87
83
  class="social-share__img-pdf"
88
84
  :src="officeFilePdfIcon"
89
- alt=""
85
+ alt="social share pdf icon"
90
86
  />
91
87
  </a></div
92
88
  ></b-button>
@@ -96,64 +92,64 @@
96
92
  </template>
97
93
 
98
94
  <script>
99
- import emailIcon from '../../../assets/icons/SocialShare/email-white.svg?url'
100
- import facebookIcon from '../../../assets/icons/SocialShare/facebook-white.svg?url'
101
- import twitterIcon from '../../../assets/icons/SocialShare/x-icon-white.svg?url'
102
- import officeFilePdfIcon from '../../../assets/icons/SocialShare/office-file-pdf.svg?url'
103
- import { BButton, BButtonGroup } from 'bootstrap-vue-next'
95
+ import emailIcon from "../../../assets/icons/SocialShare/email-white.svg?url";
96
+ import facebookIcon from "../../../assets/icons/SocialShare/facebook-white.svg?url";
97
+ import twitterIcon from "../../../assets/icons/SocialShare/x-icon-white.svg?url";
98
+ import officeFilePdfIcon from "../../../assets/icons/SocialShare/office-file-pdf.svg?url";
99
+ import { BButton, BButtonGroup } from "bootstrap-vue-next";
104
100
 
105
101
  export default {
106
- name: 'SocialShare',
107
- components: { BButtonGroup, BButton },
108
- props: {
109
- rtl: {
110
- type: Boolean,
111
- default: false
112
- }
102
+ name: "SocialShare",
103
+ components: { BButtonGroup, BButton },
104
+ props: {
105
+ rtl: {
106
+ type: Boolean,
107
+ default: false,
113
108
  },
114
- data() {
115
- return {
116
- url: null,
117
- emailIcon,
118
- facebookIcon,
119
- twitterIcon,
120
- officeFilePdfIcon,
121
- mobileToggle: false,
122
- rightToggle: true
123
- };
109
+ },
110
+ data() {
111
+ return {
112
+ url: null,
113
+ emailIcon,
114
+ facebookIcon,
115
+ twitterIcon,
116
+ officeFilePdfIcon,
117
+ mobileToggle: false,
118
+ rightToggle: true,
119
+ };
120
+ },
121
+ computed: {
122
+ showFacebook() {
123
+ return true;
124
124
  },
125
- computed: {
126
- showFacebook() {
127
- return true;
128
- },
129
- showTwitter() {
130
- return true;
131
- },
132
- showEmail() {
133
- return true;
134
- },
135
- showPdf() {
136
- return this.$canPrint && this.$canPrint();
137
- }
125
+ showTwitter() {
126
+ return true;
138
127
  },
139
- mounted() {
140
- let winHref = window.location.href
141
- if (winHref.toLowerCase().includes("worksafe")) {
142
- this.url = window.location.href;
143
- }
128
+ showEmail() {
129
+ return true;
144
130
  },
145
- methods: {
146
- savePdf() {
147
- window.printOnLoad = true;
148
- let URL = `/pdf${window.location.pathname}`;
149
- window.open(URL);
150
- }
131
+ showPdf() {
132
+ return this.$canPrint && this.$canPrint();
133
+ },
134
+ },
135
+ mounted() {
136
+ let winHref = window.location.href;
137
+ if (winHref.toLowerCase().includes("worksafe")) {
138
+ this.url = window.location.href;
151
139
  }
152
- }
140
+ },
141
+ methods: {
142
+ savePdf() {
143
+ window.printOnLoad = true;
144
+ let URL = `/pdf${window.location.pathname}`;
145
+ window.open(URL);
146
+ },
147
+ },
148
+ };
153
149
  </script>
154
150
 
155
151
  <style lang="scss" scoped>
156
- @import '../../../includes/scss/all';
152
+ @import "../../../includes/scss/all";
157
153
 
158
154
  .social-share {
159
155
  background: $white;
@@ -167,7 +163,7 @@ export default {
167
163
  left: 0;
168
164
  z-index: 2;
169
165
 
170
- @include mq('sm') {
166
+ @include mq("sm") {
171
167
  position: relative;
172
168
  top: auto;
173
169
  left: auto;
@@ -179,7 +175,7 @@ export default {
179
175
  &__header {
180
176
  font-size: 14px;
181
177
  line-height: 50px;
182
- @include mq('sm') {
178
+ @include mq("sm") {
183
179
  line-height: 40px;
184
180
  }
185
181
  }
@@ -191,7 +187,7 @@ export default {
191
187
  align-content: center;
192
188
  margin: auto;
193
189
 
194
- @include mq('sm') {
190
+ @include mq("sm") {
195
191
  display: block;
196
192
  margin: 0;
197
193
  flex-direction: unset;
@@ -226,7 +222,7 @@ export default {
226
222
  left: 0px;
227
223
  position: relative;
228
224
 
229
- @include mq('sm') {
225
+ @include mq("sm") {
230
226
  display: none;
231
227
  }
232
228
  }
@@ -238,10 +234,10 @@ export default {
238
234
  border: 0;
239
235
  margin-bottom: 8px;
240
236
 
241
- @include mq('sm') {
237
+ @include mq("sm") {
242
238
  margin-right: 8px;
243
239
  }
244
- @include mq('xs') {
240
+ @include mq("xs") {
245
241
  margin-bottom: 0px;
246
242
  }
247
243
  a {
@@ -264,7 +260,7 @@ export default {
264
260
 
265
261
  &__vr {
266
262
  border: 0;
267
- @include mq('sm') {
263
+ @include mq("sm") {
268
264
  border-left: 2px solid $lightgray;
269
265
  margin-left: 12px;
270
266
  }
@@ -289,7 +285,7 @@ export default {
289
285
  }
290
286
  }
291
287
  }
292
- @include mq('sm') {
288
+ @include mq("sm") {
293
289
  .fixed {
294
290
  position: fixed;
295
291
  bottom: 0;
@@ -312,7 +308,7 @@ export default {
312
308
  left: inherit;
313
309
  right: 0;
314
310
 
315
- @include mq('sm') {
311
+ @include mq("sm") {
316
312
  border-radius: 0;
317
313
  }
318
314
  }