@worksafevictoria/wcl7.5 1.10.0 → 1.12.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 (44) hide show
  1. package/package.json +1 -1
  2. package/src/assets/styles/generated-icons.scss +46 -46
  3. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +40 -46
  4. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  5. package/src/components/Common/CardGridItem/index.vue +153 -115
  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 +29 -19
  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/includes.scss +4 -2
  16. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  17. package/src/components/Global/AppHeaderNew/index.vue +126 -386
  18. package/src/components/Global/AppHeaderNew/mobile.scss +41 -6
  19. package/src/components/Global/AppHeaderNew/styles.scss +57 -45
  20. package/src/components/Global/BackToTop/index.vue +16 -16
  21. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  22. package/src/components/Global/DirectoryFilters/index.vue +24 -18
  23. package/src/components/Global/HeroHeader/index.vue +62 -73
  24. package/src/components/Global/SocialShare/index.vue +114 -129
  25. package/src/components/Global/Strip/index.vue +43 -39
  26. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +22 -24
  27. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  28. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  29. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  30. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  31. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +129 -64
  32. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  33. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +112 -66
  34. package/src/components/Paragraphs/Statistics/index.vue +9 -9
  35. package/src/components/Paragraphs/Tabs/index.vue +4 -4
  36. package/src/components/Paragraphs/TabulatedData/index.vue +27 -20
  37. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  38. package/src/components/SubComponents/Icon/README.md +2 -2
  39. package/src/components/SubComponents/Icon/example.js +1 -0
  40. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  41. package/src/components/SubComponents/Icon/index.vue +47 -47
  42. package/src/components/SubComponents/ResourceGroup/cardbody.vue +18 -16
  43. package/src/components/SubComponents/VideoThumbnail/index.vue +8 -6
  44. package/src/mock/carousel-items.js +46 -81
@@ -13,6 +13,7 @@
13
13
  :height="glyphHeight"
14
14
  :glyph="glyph"
15
15
  :class="glyphClass"
16
+ icon-alt="button icon"
16
17
  />
17
18
  <arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
18
19
  <arrow-left v-else-if="!textOnly" :class="glyphClass" />
@@ -36,6 +37,7 @@
36
37
  :height="glyphHeight"
37
38
  :glyph="glyph"
38
39
  :class="glyphClass"
40
+ icon-alt="anchor icon"
39
41
  />
40
42
  <arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
41
43
  <arrow-left v-else-if="!textOnly" :class="glyphClass" />
@@ -59,6 +61,7 @@
59
61
  :height="glyphHeight"
60
62
  :glyph="glyph"
61
63
  :class="glyphClass"
64
+ icon-alt="link icon"
62
65
  />
63
66
  <arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
64
67
  <arrow-left v-else-if="!textOnly" :class="glyphClass" />
@@ -66,12 +69,12 @@
66
69
  </template>
67
70
 
68
71
  <script>
69
- import arrowRight from '../../../assets/icons/arrow-right.svg?component'
70
- import arrowLeft from '../../../assets/icons/arrow-left.svg?component'
71
- import icon from './../Icon/index.vue'
72
+ import arrowRight from "../../../assets/icons/arrow-right.svg?component";
73
+ import arrowLeft from "../../../assets/icons/arrow-left.svg?component";
74
+ import icon from "./../Icon/index.vue";
72
75
 
73
76
  export default {
74
- name: 'CtaButton',
77
+ name: "CtaButton",
75
78
  components: {
76
79
  arrowRight,
77
80
  arrowLeft,
@@ -80,18 +83,18 @@ export default {
80
83
  props: {
81
84
  type: {
82
85
  type: String,
83
- default: 'default',
86
+ default: "default",
84
87
  validator: (value) =>
85
- ['default', 'white', 'gray', 'workwell', 'dark'].indexOf(value) >= 0,
88
+ ["default", "white", "gray", "workwell", "dark"].indexOf(value) >= 0,
86
89
  },
87
90
  url: {
88
91
  type: String,
89
92
  required: false,
90
- default: '',
93
+ default: "",
91
94
  },
92
95
  alt: {
93
96
  type: String,
94
- default: '',
97
+ default: "",
95
98
  },
96
99
  rtl: {
97
100
  type: Boolean,
@@ -138,15 +141,15 @@ export default {
138
141
  },
139
142
  focusOutline: {
140
143
  type: String,
141
- default: 'default',
142
- validator: (value) => ['default', 'light', 'dark'].indexOf(value) >= 0,
144
+ default: "default",
145
+ validator: (value) => ["default", "light", "dark"].indexOf(value) >= 0,
143
146
  },
144
147
  },
145
148
  data() {
146
149
  return {
147
150
  arrowRight,
148
151
  arrowLeft,
149
- }
152
+ };
150
153
  },
151
154
  computed: {
152
155
  // var r = new RegExp('^(?:[a-z]+:)?//', 'i');
@@ -158,81 +161,81 @@ export default {
158
161
  // r.test('/myfolder/test.txt'); // false - relative URL
159
162
  // r.test('test'); // false - also relative URL
160
163
  isAbsolute() {
161
- let r = new RegExp('^(?:[a-z]+:)?//', 'i')
162
- return r.test(this.url)
164
+ let r = new RegExp("^(?:[a-z]+:)?//", "i");
165
+ return r.test(this.url);
163
166
  },
164
167
  // Some links come out of Drupal in the format `entity:node/551`
165
168
  // As an interim solution, make the link go to `node/551` and it
166
169
  // will render correctly. Not ideal as it doesn't forward to the
167
170
  // friendly link. Should come out of Drupal with a proper alias.
168
171
  linkUriProcessed() {
169
- if (this.url?.indexOf('entity:') === 0) {
170
- return this.url.slice(7)
171
- } else if (this.url?.indexOf('internal:') === 0) {
172
- return this.url.slice(9)
172
+ if (this.url?.indexOf("entity:") === 0) {
173
+ return this.url.slice(7);
174
+ } else if (this.url?.indexOf("internal:") === 0) {
175
+ return this.url.slice(9);
173
176
  } else {
174
- return this.url
177
+ return this.url;
175
178
  }
176
179
  },
177
180
  generatedClass() {
178
- return `wcl-cta ${this.type} ${this.rtl ? 'rtl' : ''} ${
179
- this.workwell ? 'workwell' : ''
180
- } ${this.isCentred ? 'text-center' : ''} ${
181
- this.textOnly ? 'wcl-cta--text-only' : ''
182
- } ${this.stretch ? 'wcl-cta--stretch' : ''} ${
183
- this.slim ? 'wcl-cta--slim' : ''
184
- } ${'wcl-cta--focus-' + this.focusOutline}`
181
+ return `wcl-cta ${this.type} ${this.rtl ? "rtl" : ""} ${
182
+ this.workwell ? "workwell" : ""
183
+ } ${this.isCentred ? "text-center" : ""} ${
184
+ this.textOnly ? "wcl-cta--text-only" : ""
185
+ } ${this.stretch ? "wcl-cta--stretch" : ""} ${this.slim ? "wcl-cta--slim" : ""} ${
186
+ "wcl-cta--focus-" + this.focusOutline
187
+ }`;
185
188
  },
186
189
  glyphClass() {
187
- const hasArrow = !this.glyph && !this.textOnly
190
+ const hasArrow = !this.glyph && !this.textOnly;
188
191
  return this.isCentred
189
- ? { ['wcl-cta__arrow']: hasArrow }
192
+ ? { ["wcl-cta__arrow"]: hasArrow }
190
193
  : {
191
- ['wcl-cta__arrow']: hasArrow,
192
- }
194
+ ["wcl-cta__arrow"]: hasArrow,
195
+ };
193
196
  },
194
197
  textClass() {
195
- return this.isCentred ? {} : {}
198
+ return this.isCentred ? {} : {};
196
199
  },
197
200
  },
198
201
  methods: {
199
202
  clicked() {
200
- var theEl = this.$el.getElementsByClassName('wcl-cta__link-text')
201
- var attrs
203
+ var theEl = this.$el.getElementsByClassName("wcl-cta__link-text");
204
+ var attrs;
202
205
  if (theEl && theEl.length > 0) {
203
206
  attrs = {
204
207
  //group: this.$store?.state?.page?.content?.title,
205
208
  group: this.$pageStore?.content?.title,
206
- label: theEl[0]?.innerText?.split('\n')[0],
209
+ label: theEl[0]?.innerText?.split("\n")[0],
207
210
  data: this.url,
208
- }
211
+ };
209
212
  } else {
210
213
  attrs = {
211
214
  //group: this.$store?.state?.page?.content?.title,
212
215
  group: this.$pageStore?.content?.title,
213
- label: '',
216
+ label: "",
214
217
  data: this.url,
215
- }
218
+ };
216
219
  }
217
220
  // push event to gtm
218
221
  if (this.$gtm) {
219
- this.$gtm.push({ event: 'custom.interaction.cta.click', ...attrs })
222
+ this.$gtm.push({ event: "custom.interaction.cta.click", ...attrs });
220
223
  }
221
224
  // navigate to url
222
225
  if (!this.url) {
223
226
  //donothing
224
227
  } else if (this.isAbsolute) {
225
- window.open(this.url)
228
+ window.open(this.url);
226
229
  } else {
227
- this.$router.push(this.url)
230
+ this.$router.push(this.url);
228
231
  }
229
- this.$emit('clicked')
232
+ this.$emit("clicked");
230
233
  },
231
234
  },
232
- }
235
+ };
233
236
  </script>
234
237
  <style lang="scss" scoped>
235
- @import '../../../includes/scss/all';
238
+ @import "../../../includes/scss/all";
236
239
  // styles can be found in global src/assets/styles/stylesheet.scss
237
240
  // this is because rich text html can dynamically specify cta button class
238
241
  .wcl-cta {
@@ -245,12 +248,12 @@ export default {
245
248
  &--focus {
246
249
  &-light {
247
250
  &:focus {
248
- @include focus-outline('light');
251
+ @include focus-outline("light");
249
252
  }
250
253
  }
251
254
  &-dark {
252
255
  &:focus {
253
- @include focus-outline('dark');
256
+ @include focus-outline("dark");
254
257
  }
255
258
  }
256
259
  }
@@ -9,8 +9,8 @@ Import the Icon component, and give it the URL path to the SVG file. When webpac
9
9
  ```html
10
10
  <template>
11
11
  <div id="app">
12
- <icon width="100" height="100" :glyph="Logo"></icon>
13
- <icon width="100" height="100" :glyph="Close"></icon>
12
+ <icon width="100" height="100" :glyph="Logo" icon-alt="Logo icon"></icon>
13
+ <icon width="100" height="100" :glyph="Close" icon-alt="Close icon"></icon>
14
14
  </div>
15
15
  </template>
16
16
 
@@ -3,6 +3,7 @@ const template = `
3
3
  width="40"
4
4
  height="40"
5
5
  glyph="icon"
6
+ icon-alt="icon"
6
7
  />
7
8
  `
8
9
 
@@ -29,7 +29,7 @@ const generate = (args) => ({
29
29
  },
30
30
  template: `
31
31
  <div style="margin-top:15px" :style="{background: !args.inverted ? 'white' : 'grey'}">
32
- <icon v-bind="args" />
32
+ <icon v-bind="args" icon-alt="icon" />
33
33
  </div>`
34
34
  })
35
35
 
@@ -7,9 +7,9 @@
7
7
  aria-hidden="true"
8
8
  :class="
9
9
  className +
10
- (first ? ' icon_first' : '') +
11
- (last ? ' icon_last' : '') +
12
- (inverted ? ' icon--inverted' : '')
10
+ (first ? ' icon_first' : '') +
11
+ (last ? ' icon_last' : '') +
12
+ (inverted ? ' icon--inverted' : '')
13
13
  "
14
14
  :width="width"
15
15
  :height="height"
@@ -24,104 +24,104 @@
24
24
  </template>
25
25
 
26
26
  <script>
27
- import { detectBrowser } from '../../../../lib/detect-browser'
27
+ import { detectBrowser } from "../../../../lib/detect-browser";
28
28
  // TODO: Add .visually-hidden label prop
29
29
  export default {
30
- name: 'Icon',
30
+ name: "Icon",
31
31
  props: {
32
32
  className: {
33
33
  type: String,
34
- default: ''
34
+ default: "",
35
35
  },
36
36
  glyph: {
37
37
  type: [Object, String],
38
- required: true
38
+ required: true,
39
39
  },
40
40
  width: {
41
41
  type: [Number, String],
42
- default: 32
42
+ default: 32,
43
43
  },
44
44
  height: {
45
45
  // height is required in IE
46
46
  // undefined type added in case height was going to be handled explicitly, check JobsAtHomeDay for more details
47
47
  type: [Number, String],
48
- default: 32
48
+ default: 32,
49
49
  },
50
50
  first: {
51
51
  type: Boolean,
52
- default: false
52
+ default: false,
53
53
  },
54
54
  last: {
55
55
  type: Boolean,
56
- default: false
56
+ default: false,
57
57
  },
58
58
  inverted: {
59
59
  type: Boolean,
60
- default: false
60
+ default: false,
61
61
  },
62
62
  bordered: {
63
63
  type: Boolean,
64
- default: false
64
+ default: false,
65
65
  },
66
66
  iconAlt: {
67
67
  type: String,
68
- default: ''
69
- }
68
+ default: "",
69
+ },
70
70
  },
71
71
  data() {
72
72
  return {
73
- renderedSVG: undefined
74
- }
73
+ renderedSVG: undefined,
74
+ };
75
75
  },
76
76
  computed: {
77
77
  isHtml() {
78
- return this.glyph && typeof this.glyph === 'string'
79
- }
78
+ return this.glyph && typeof this.glyph === "string";
79
+ },
80
80
  },
81
81
  mounted() {
82
- this.renderedSVG = this.getSvg()
82
+ this.renderedSVG = this.getSvg();
83
83
  },
84
84
  methods: {
85
85
  getSvg() {
86
86
  if (this.glyph) {
87
- let icon
88
- const content = String(this.glyph)
89
- const isSVGTag = content.includes('<svg')
87
+ let icon;
88
+ const content = String(this.glyph);
89
+ const isSVGTag = content.includes("<svg");
90
90
  if (!isSVGTag) {
91
- icon = document.createElement('img')
92
- icon.src = content
91
+ icon = document.createElement("img");
92
+ icon.src = content;
93
93
  } else {
94
- if (window && navigator && detectBrowser(navigator) === 'IE') {
95
- return this.glyph
94
+ if (window && navigator && detectBrowser(navigator) === "IE") {
95
+ return this.glyph;
96
96
  } else {
97
- const temp = document.createElement('div')
98
- temp.innerHTML = content
99
- icon = temp.querySelector('svg')
100
- icon.removeAttribute('width')
101
- icon.removeAttribute('height')
97
+ const temp = document.createElement("div");
98
+ temp.innerHTML = content;
99
+ icon = temp.querySelector("svg");
100
+ icon.removeAttribute("width");
101
+ icon.removeAttribute("height");
102
102
  }
103
103
  }
104
104
  if (this.iconAlt) {
105
- icon.setAttribute('alt', this.iconAlt)
105
+ icon.setAttribute("alt", this.iconAlt);
106
106
  }
107
- icon.setAttribute('width', this.width)
108
- icon.setAttribute('height', this.height)
107
+ icon.setAttribute("width", this.width);
108
+ icon.setAttribute("height", this.height);
109
109
  const customClass =
110
110
  this.className +
111
- (this.first ? ' icon_first' : '') +
112
- (this.last ? ' icon_last' : '') +
113
- (this.inverted ? ' icon--inverted' : '')
114
- icon.setAttribute('class', 'icon ' + customClass)
115
- icon.setAttribute('focusable', false)
116
- icon.setAttribute('aria-hidden', true)
117
- return icon.outerHTML
111
+ (this.first ? " icon_first" : "") +
112
+ (this.last ? " icon_last" : "") +
113
+ (this.inverted ? " icon--inverted" : "");
114
+ icon.setAttribute("class", "icon " + customClass);
115
+ icon.setAttribute("focusable", false);
116
+ icon.setAttribute("aria-hidden", true);
117
+ return icon.outerHTML;
118
118
  }
119
- return null
120
- }
121
- }
122
- }
119
+ return null;
120
+ },
121
+ },
122
+ };
123
123
  </script>
124
124
 
125
125
  <style lang="scss">
126
- @import './styles';
126
+ @import "./styles";
127
127
  </style>
@@ -17,11 +17,13 @@
17
17
  :aria-expanded="
18
18
  isMobile || isResourceGroup
19
19
  ? cardMenuIsOpen
20
- ? 'true'
21
- : 'false'
20
+ ? true
21
+ : false
22
22
  : false
23
23
  "
24
24
  role="button"
25
+ :aria-controls="`menu-panel-${card.ItemId}`"
26
+ tabindex="0"
25
27
  class="card_item-menu__title--link nolink"
26
28
  >
27
29
  <img
@@ -30,7 +32,7 @@
30
32
  height="12"
31
33
  width="17"
32
34
  class="card_item-menu__title__caret"
33
- alt=""
35
+ alt="Card item Menu Title expand icon"
34
36
  />
35
37
  <img
36
38
  v-show="cardMenuIsOpen"
@@ -38,7 +40,7 @@
38
40
  height="12"
39
41
  width="17"
40
42
  class="card_item-menu__title__caret"
41
- alt=""
43
+ alt="Card item Menu Title collapse icon"
42
44
  />
43
45
  <h3 class="card_item-menu__title--small">
44
46
  {{ card.dropdownTitle }}
@@ -49,7 +51,7 @@
49
51
  v-if="card.fileType"
50
52
  class="card_item-menu__item card_item-menu__item--link"
51
53
  :class="{
52
- 'card_item-menu__item--hide': !cardMenuIsOpen
54
+ 'card_item-menu__item--hide': !cardMenuIsOpen,
53
55
  }"
54
56
  >
55
57
  {{ card.fileTypeTitle }}
@@ -64,7 +66,7 @@
64
66
  v-if="card.fileSize"
65
67
  class="card_item-menu__item card_item-menu__item--link"
66
68
  :class="{
67
- 'card_item-menu__item--hide': !cardMenuIsOpen
69
+ 'card_item-menu__item--hide': !cardMenuIsOpen,
68
70
  }"
69
71
  >
70
72
  {{ card.fileSizeTitle }}
@@ -79,7 +81,7 @@
79
81
  v-if="card.fileLength"
80
82
  class="card_item-menu__item card_item-menu__item--link"
81
83
  :class="{
82
- 'card_item-menu__item--hide': !cardMenuIsOpen
84
+ 'card_item-menu__item--hide': !cardMenuIsOpen,
83
85
  }"
84
86
  >
85
87
  {{ card.fileLengthTitle }}
@@ -94,7 +96,7 @@
94
96
  v-if="card.readingLevel"
95
97
  class="card_item-menu__item card_item-menu__item--link"
96
98
  :class="{
97
- 'card_item-menu__item--hide': !cardMenuIsOpen
99
+ 'card_item-menu__item--hide': !cardMenuIsOpen,
98
100
  }"
99
101
  >
100
102
  {{ card.readingLevelTitle }}
@@ -132,17 +134,17 @@ export default {
132
134
  Column,
133
135
  Row,
134
136
  CardFooter,
135
- RichText
137
+ RichText,
136
138
  },
137
139
  props: {
138
140
  card: {
139
141
  type: Object,
140
- required: true
142
+ required: true,
141
143
  },
142
144
  resourceType: {
143
145
  type: String,
144
- default: 'resource-group'
145
- }
146
+ default: 'resource-group',
147
+ },
146
148
  },
147
149
  data() {
148
150
  return {
@@ -152,7 +154,7 @@ export default {
152
154
  documentsvg,
153
155
  CaretUp,
154
156
  CaretDown,
155
- windowWidth: 0
157
+ windowWidth: 0,
156
158
  }
157
159
  },
158
160
  computed: {
@@ -161,7 +163,7 @@ export default {
161
163
  },
162
164
  isResourceGroup() {
163
165
  return this.cardResourseType === 'resource-group' ? true : false
164
- }
166
+ },
165
167
  },
166
168
  mounted() {
167
169
  this.$nextTick(() => {
@@ -211,8 +213,8 @@ export default {
211
213
  })
212
214
  }
213
215
  }
214
- }
215
- }
216
+ },
217
+ },
216
218
  }
217
219
  </script>
218
220
  <style lang="scss" scoped>
@@ -4,27 +4,29 @@
4
4
  <div class="video-thumbnail">
5
5
  <img
6
6
  :src="videoThumbnail"
7
- alt="video thumbnail"
7
+ :alt="`Thumbnail for video: ${video.mediaTitle}`"
8
8
  width="100%"
9
9
  class="video-thumbnail__image"
10
10
  />
11
11
  <img
12
12
  :src="VideoPlay"
13
- alt="Play button"
13
+ alt="Video play button"
14
+ aria-hidden="true"
14
15
  class="video-thumbnail__button"
15
16
  />
16
17
  </div>
17
18
  </a>
18
19
  <!-- Modal -->
19
- <b-modal
20
- :id="`wcl-video-modal`"
20
+ <BModal
21
+ v-if="showModal"
21
22
  v-model="showModal"
23
+ :id="`wcl-video-modal-${video.id}`"
22
24
  scrollable
23
25
  class="wcl-video-modal__modal"
24
26
  no-footer
25
27
  size="xl"
26
28
  >
27
- <div class="wcl-video-modal__video" v-if="showModal">
29
+ <div class="wcl-video-modal__video">
28
30
  <video-media
29
31
  :media-title="video.mediaTitle"
30
32
  :media-description="video.mediaDescription"
@@ -37,7 +39,7 @@
37
39
  />
38
40
  </div>
39
41
  <template #footer><div></div></template>
40
- </b-modal>
42
+ </BModal>
41
43
  </div>
42
44
  </template>
43
45