@worksafevictoria/wcl7.5 1.3.0 → 1.5.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 (29) hide show
  1. package/lib/utility.js +1 -1
  2. package/package.json +1 -2
  3. package/src/components/Common/CardGrid/index.vue +17 -2
  4. package/src/components/Common/CardGridItem/index.vue +20 -10
  5. package/src/components/Containers/Carousel/index.stories.js +30 -0
  6. package/src/components/Containers/Carousel/index.vue +165 -0
  7. package/src/components/Containers/HomepageHeaderNew/index.stories.js +75 -0
  8. package/src/components/Containers/HomepageHeaderNew/index.vue +198 -0
  9. package/src/components/Containers/Subheader/index.vue +8 -2
  10. package/src/components/Global/AppFooter/index.vue +30 -28
  11. package/src/components/Global/AppHeader/index.vue +9 -10
  12. package/src/components/Global/AppHeaderNew/index.vue +313 -242
  13. package/src/components/Global/AppHeaderNew/styles.scss +26 -0
  14. package/src/components/Global/ContrastMode/index.vue +1 -1
  15. package/src/components/Global/Cookies/index.vue +7 -0
  16. package/src/components/Global/HeroHeader/index.vue +12 -13
  17. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -17
  18. package/src/components/Paragraphs/BrowseContent/index.vue +1 -5
  19. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +2 -2
  20. package/src/components/Paragraphs/ListGroup/index.vue +55 -46
  21. package/src/components/Paragraphs/Statistics/index.vue +1 -0
  22. package/src/components/Paragraphs/TabbedCards/index.vue +42 -38
  23. package/src/components/SubComponents/CardGroup/index.vue +33 -27
  24. package/src/components/SubComponents/CtaButton/index.vue +27 -25
  25. package/src/components/SubComponents/ResourceGroup/index.vue +13 -4
  26. package/src/includes/scss/mixins/src/grid.scss +4 -2
  27. package/src/includes/scss/mixins/src/units.scss +25 -4
  28. package/src/mock/app-header-new.js +27 -15
  29. package/src/mock/carousel-items.js +57 -0
@@ -26,7 +26,7 @@
26
26
  class="card_group__card"
27
27
  :class="{
28
28
  [`card_group__card--${card.colour}`]: card.pillText,
29
- [`card_group__card--none`]: !card.pillText
29
+ [`card_group__card--none`]: !card.pillText,
30
30
  }"
31
31
  :card-header-title="card.title"
32
32
  :caret="getCaret(card)"
@@ -40,7 +40,7 @@
40
40
  :taxonomies="{
41
41
  industry: card.industry,
42
42
  topic: card.topic,
43
- language: card.language
43
+ language: card.language,
44
44
  }"
45
45
  >
46
46
  <template v-slot:cardTop>
@@ -55,9 +55,9 @@
55
55
  <template
56
56
  v-if="
57
57
  loading ||
58
- (cards.length === 0 && !loading) ||
59
- $slots.cardGroupFooter ||
60
- (!loading && showLoadMore)
58
+ (cards.length === 0 && !loading) ||
59
+ $slots.cardGroupFooter ||
60
+ (!loading && showLoadMore)
61
61
  "
62
62
  v-slot:cardGridFooter
63
63
  >
@@ -93,7 +93,7 @@ import Column from './../../Containers/Column/index.vue'
93
93
  import {
94
94
  isAbsoluteUrl,
95
95
  navigateToPath,
96
- isGovSite
96
+ isGovSite,
97
97
  } from './../../../../lib/utility'
98
98
  import CardBody from './cardbody.vue'
99
99
  import CardTop from './cardtop.vue'
@@ -109,57 +109,57 @@ export default {
109
109
  CardBody,
110
110
  CardTop,
111
111
  CtaButton,
112
- BSpinner
113
- },
112
+ BSpinner,
113
+ },
114
114
  props: {
115
115
  bundle: {
116
116
  type: Array,
117
117
  required: false,
118
- default: () => []
118
+ default: () => [],
119
119
  },
120
120
  caret: {
121
121
  type: String,
122
122
  default: undefined,
123
123
  validator: (value) =>
124
- ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0
124
+ ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0,
125
125
  },
126
126
  cards: {
127
127
  type: Array,
128
128
  required: true,
129
- default: () => []
129
+ default: () => [],
130
130
  },
131
131
  background: {
132
132
  type: String,
133
- default: 'none'
133
+ default: 'none',
134
134
  },
135
135
  title: {
136
136
  type: String,
137
- default: null
137
+ default: null,
138
138
  },
139
139
  titleTag: {
140
140
  type: String,
141
- default: 'h2'
141
+ default: 'h2',
142
142
  },
143
143
  rtl: {
144
144
  type: Boolean,
145
- default: false
145
+ default: false,
146
146
  },
147
147
  loading: {
148
148
  type: Boolean,
149
- default: false
149
+ default: false,
150
150
  },
151
151
  columns: {
152
152
  type: Number,
153
- default: 3
153
+ default: 3,
154
154
  },
155
155
  showLoadMore: {
156
156
  type: Boolean,
157
- default: false
157
+ default: false,
158
158
  },
159
159
  emptyCardsText: {
160
160
  type: String,
161
- default: 'No results returned'
162
- }
161
+ default: 'No results returned',
162
+ },
163
163
  },
164
164
  computed: {
165
165
  allCardsRTL() {
@@ -167,7 +167,7 @@ export default {
167
167
  return this.rtl
168
168
  }
169
169
  return this.cards.every((card) => this.rtl || card.rtl)
170
- }
170
+ },
171
171
  },
172
172
  methods: {
173
173
  getCaret(card) {
@@ -181,24 +181,30 @@ export default {
181
181
  // Some custom logic for gov caretaker logic
182
182
  if (process.env.CARETAKER && process.env.CARETAKER === 'true') {
183
183
  if (!isGovSite(card?.selectedCard?.link)) {
184
- this.$store.commit('page/SET_CARETAKER_REF', 'card-group')
185
- this.$root.$emit('caretaker-open', card?.selectedCard?.link)
184
+ // this.$store.commit('page/SET_CARETAKER_REF', 'card-group')
185
+ // this.$root.$emit('caretaker-open', card?.selectedCard?.link)
186
+ if (this.$pageStore) {
187
+ this.$pageStore.caretaker.referrer = 'card-group'
188
+ }
189
+ if (this.$bus) {
190
+ this.$bus.$emit('caretaker-open', card?.selectedCard?.link)
191
+ }
186
192
  } else {
187
193
  navigateToPath.call(
188
194
  this,
189
195
  card?.selectedCard?.link,
190
- card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
196
+ card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
191
197
  )
192
198
  }
193
199
  } else {
194
200
  navigateToPath.call(
195
201
  this,
196
202
  card?.selectedCard?.link,
197
- card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
203
+ card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
198
204
  )
199
205
  }
200
- }
201
- }
206
+ },
207
+ },
202
208
  }
203
209
  </script>
204
210
 
@@ -75,77 +75,77 @@ export default {
75
75
  components: {
76
76
  arrowRight,
77
77
  arrowLeft,
78
- icon
78
+ icon,
79
79
  },
80
80
  props: {
81
81
  type: {
82
82
  type: String,
83
83
  default: 'default',
84
84
  validator: (value) =>
85
- ['default', 'white', 'gray', 'workwell', 'dark'].indexOf(value) >= 0
85
+ ['default', 'white', 'gray', 'workwell', 'dark'].indexOf(value) >= 0,
86
86
  },
87
87
  url: {
88
88
  type: String,
89
89
  required: false,
90
- default: ''
90
+ default: '',
91
91
  },
92
92
  alt: {
93
93
  type: String,
94
- default: ''
94
+ default: '',
95
95
  },
96
96
  rtl: {
97
97
  type: Boolean,
98
- default: false
98
+ default: false,
99
99
  },
100
100
  glyph: {
101
101
  type: [Object, String],
102
102
  required: false,
103
- default: () => null
103
+ default: () => null,
104
104
  },
105
105
  glyphHeight: {
106
106
  type: Number,
107
107
  required: false,
108
- default: 15
108
+ default: 15,
109
109
  },
110
110
  glyphWidth: {
111
111
  type: Number,
112
112
  required: false,
113
- default: 25
113
+ default: 25,
114
114
  },
115
115
  workwell: {
116
116
  type: Boolean,
117
- default: false
117
+ default: false,
118
118
  },
119
119
  isCentred: {
120
120
  type: Boolean,
121
- default: false
121
+ default: false,
122
122
  },
123
123
  textOnly: {
124
124
  type: Boolean,
125
- default: false
125
+ default: false,
126
126
  },
127
127
  isFluid: {
128
128
  type: Boolean,
129
- default: true
129
+ default: true,
130
130
  },
131
131
  stretch: {
132
132
  type: Boolean,
133
- default: false
133
+ default: false,
134
134
  },
135
135
  slim: {
136
136
  type: Boolean,
137
- default: false
137
+ default: false,
138
138
  },
139
139
  focusOutline: {
140
140
  type: String,
141
141
  default: 'default',
142
- validator: (value) => ['default', 'light', 'dark'].indexOf(value) >= 0
143
- }
142
+ validator: (value) => ['default', 'light', 'dark'].indexOf(value) >= 0,
143
+ },
144
144
  },
145
145
  data() {
146
146
  return {
147
147
  arrowRight,
148
- arrowLeft
148
+ arrowLeft,
149
149
  }
150
150
  },
151
151
  computed: {
@@ -188,12 +188,12 @@ export default {
188
188
  return this.isCentred
189
189
  ? { ['wcl-cta__arrow']: hasArrow }
190
190
  : {
191
- ['wcl-cta__arrow']: hasArrow
191
+ ['wcl-cta__arrow']: hasArrow,
192
192
  }
193
193
  },
194
194
  textClass() {
195
195
  return this.isCentred ? {} : {}
196
- }
196
+ },
197
197
  },
198
198
  methods: {
199
199
  clicked() {
@@ -201,15 +201,17 @@ export default {
201
201
  var attrs
202
202
  if (theEl && theEl.length > 0) {
203
203
  attrs = {
204
- group: this.$store?.state?.page?.content?.title,
204
+ //group: this.$store?.state?.page?.content?.title,
205
+ group: this.$pageStore?.content?.title,
205
206
  label: theEl[0]?.innerText?.split('\n')[0],
206
- data: this.url
207
+ data: this.url,
207
208
  }
208
209
  } else {
209
210
  attrs = {
210
- group: this.$store?.state?.page?.content?.title,
211
+ //group: this.$store?.state?.page?.content?.title,
212
+ group: this.$pageStore?.content?.title,
211
213
  label: '',
212
- data: this.url
214
+ data: this.url,
213
215
  }
214
216
  }
215
217
  // push event to gtm
@@ -225,8 +227,8 @@ export default {
225
227
  this.$router.push(this.url)
226
228
  }
227
229
  this.$emit('clicked')
228
- }
229
- }
230
+ },
231
+ },
230
232
  }
231
233
  </script>
232
234
  <style lang="scss" scoped>
@@ -307,7 +307,8 @@ export default {
307
307
  },
308
308
  async loadMoreCards(init) {
309
309
  const attrs = {
310
- group: this.$store?.state?.page?.content?.title,
310
+ group: this.$pageStore?.content?.title,
311
+ //group: this.$store?.state?.page?.content?.title,
311
312
  }
312
313
  if (this.$gtm && !init) {
313
314
  this.$gtm.push({ event: 'custom.interaction.showmore.click', ...attrs })
@@ -439,8 +440,14 @@ export default {
439
440
  // Some custom logic for gov caretaker logic
440
441
  if (process.env.CARETAKER && process.env.CARETAKER === 'true') {
441
442
  if (!isGovSite(card?.selectedCard?.link)) {
442
- this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
443
- this.$root.$emit('caretaker-open', card?.selectedCard?.link)
443
+ // this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
444
+ // this.$root.$emit('caretaker-open', card?.selectedCard?.link)
445
+ if (this.$pageStore) {
446
+ this.$pageStore.caretaker.referrer = 'list-group'
447
+ }
448
+ if (this.$bus) {
449
+ this.$bus.$emit('caretaker-open', card?.selectedCard?.link)
450
+ }
444
451
  } else {
445
452
  navigateToPath.call(
446
453
  this,
@@ -493,7 +500,9 @@ export default {
493
500
  nextTabbedCard[0].focus()
494
501
  } else {
495
502
  let nextFocus = this.focusNextElement()
496
- this.$root.$emit('last-focus-out')
503
+ if (this.$bus) {
504
+ this.$bus.$emit('last-focus-out')
505
+ }
497
506
  nextFocus.focus()
498
507
  }
499
508
  } else {
@@ -7,14 +7,16 @@ $grid-breakpoints: (
7
7
  sm: 576px,
8
8
  md: 768px,
9
9
  lg: 992px,
10
- xl: 1200px
10
+ xl: 1200px,
11
+ xxl: 1400px
11
12
  );
12
13
 
13
14
  $container-max-widths: (
14
15
  sm: 540px,
15
16
  md: 720px,
16
17
  lg: 960px,
17
- xl: 1140px
18
+ xl: 1140px,
19
+ xxl: 1320px
18
20
  );
19
21
 
20
22
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
@@ -1,3 +1,4 @@
1
+ @use "sass:math";
1
2
  $current-rootsize: 16px;
2
3
 
3
4
  // Returns a unitless number
@@ -53,10 +54,11 @@ $current-rootsize: 16px;
53
54
 
54
55
 
55
56
  // Converts a px value to rems. Should only work in absolute em document context (root level), unless $context is specified
56
- @function px-to-rem($value, $context: $current-rootsize) {
57
- @if unit($context) == "rem" {
58
- $context: rem-to-px($context);
59
- }
57
+ /**/
58
+ /* @function px-to-rem($value, $context: $current-rootsize) {
59
+ //@if unit($context) == "rem" {
60
+ // $context: rem-to-px($context);
61
+ //}
60
62
  $result: ();
61
63
 
62
64
  @each $val in $value {
@@ -67,6 +69,25 @@ $current-rootsize: 16px;
67
69
  }
68
70
  }
69
71
  @return $result;
72
+ } */
73
+
74
+ @function px-to-rem($px, $context: $current-rootsize) {
75
+ @if unit($context) == "rem" {
76
+ $context: rem-to-px($context);
77
+ }
78
+ $result: ();
79
+
80
+ // Iterate over each value in the $px list
81
+ @each $val in $px {
82
+ @if unit($val) == "px" {
83
+ // Convert px to rem
84
+ $val: #{math.div($val, $context)}rem;
85
+ }
86
+ // Append converted value to the result list
87
+ $result: append($result, $val);
88
+ }
89
+
90
+ @return $result;
70
91
  }
71
92
 
72
93
  // Converts a em value to rems. Should only work in absolute em document context (root level), unless $context is specified
@@ -681,23 +681,35 @@ const appHeaderData = [
681
681
  {
682
682
  title: 'Extra Link Two',
683
683
  absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
684
+ relative: '/licences',
685
+ below: [
686
+ {
687
+ title: 'Contact WorkSafe',
688
+ absolute: 'https://content-v2.api.worksafe.vic.gov.au/contact-worksafe',
689
+ relative: '/contact-worksafe'
690
+ },
691
+ {
692
+ title: 'Report an incident',
693
+ absolute: 'https://content-v2.api.worksafe.vic.gov.au/report-incident',
694
+ relative: '/report-incident'
695
+ }
696
+ ]
697
+ },
698
+ {
699
+ title: 'Extra Link Three',
700
+ absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
701
+ relative: '/licences'
702
+ },
703
+ {
704
+ title: 'External Link',
705
+ absolute: 'http://google.com',
706
+ relative: ''
707
+ },
708
+ {
709
+ title: 'Extra Link Five',
710
+ absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
684
711
  relative: '/licences'
685
712
  },
686
- // {
687
- // title: 'Extra Link Three',
688
- // absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
689
- // relative: '/licences'
690
- // },
691
- // {
692
- // title: 'Extra Link Four',
693
- // absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
694
- // relative: '/licences'
695
- // },
696
- // {
697
- // title: 'Extra Link Five',
698
- // absolute: 'https://content-v2.api.worksafe.vic.gov.au/licences',
699
- // relative: '/licences'
700
- // },
701
713
  ]
702
714
 
703
715
  export { appHeaderData }
@@ -0,0 +1,57 @@
1
+ export const mockCarouselItems = [
2
+ {
3
+ content: 'This is the first slider',
4
+ image:
5
+ 'https://picsum.photos/1024/480/?image=52',
6
+ link: 'www.google.com',
7
+ dateStart: '2024-01-12T09:45:00+11:00',
8
+ dateEnd: '2024-02-12T09:45:00+11:00',
9
+ favorite: 'Yes'
10
+ },
11
+ {
12
+ content: 'This is the second slider',
13
+ image:
14
+ 'https://picsum.photos/1024/480/?image=54',
15
+ link: '/asbestos-removal-notification',
16
+ dateStart: '2025-12-01T09:45:00+11:00',
17
+ dateEnd: '2025-12-12T09:45:00+11:00',
18
+ favorite: ''
19
+ },
20
+ {
21
+ content: 'This is the third slider',
22
+ image:
23
+ 'https://picsum.photos/1024/480/?image=56',
24
+ link: '/dangerous-goods-licences',
25
+ dateStart: '2024-01-12T09:45:00+11:00',
26
+ dateEnd: '2024-12-12T09:45:00+11:00',
27
+ favorite: ''
28
+ },
29
+ {
30
+ content: 'This is the fourth slider',
31
+ image:
32
+ 'https://picsum.photos/1024/480/?image=58',
33
+ link: '/construction',
34
+ dateStart: '2025-10-30T09:45:00+11:00',
35
+ dateEnd: '2025-12-12T09:45:00+11:00',
36
+ favorite: ''
37
+ },
38
+ {
39
+ content: '',
40
+ image:
41
+ 'https://picsum.photos/1024/480/?image=60',
42
+ link: '/construction',
43
+ dateStart: '2024-10-30T09:45:00+11:00',
44
+ dateEnd: '2025-12-12T09:45:00+11:00',
45
+ favorite: ''
46
+ },
47
+ {
48
+ content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla consectetur ligula ex',
49
+ image:
50
+ 'https://picsum.photos/1024/480/?image=62',
51
+ link: '/construction',
52
+ dateStart: '2024-10-30T09:45:00+11:00',
53
+ dateEnd: '2025-11-12T09:45:00+11:00',
54
+ favorite: ''
55
+ },
56
+ ]
57
+