@worksafevictoria/wcl7.5 1.0.0 → 1.1.0-beta.10

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 (55) hide show
  1. package/.env +4 -2
  2. package/.eslintrc.cjs +1 -1
  3. package/.eslintrc.js +2 -1
  4. package/.husky/pre-commit +4 -0
  5. package/.storybook/main.js +4 -2
  6. package/.storybook/preview.js +15 -0
  7. package/README.md +14 -0
  8. package/babel.config.js +7 -6
  9. package/bin/deploy.sh +3 -3
  10. package/ci/build/build_validation.yml +11 -6
  11. package/ci/release/beta.yml +6 -5
  12. package/ci/release/master.yml +6 -5
  13. package/jest.config.js +3 -1
  14. package/package.json +16 -9
  15. package/public/.nojekyll +1 -0
  16. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  17. package/src/components/Common/CardGridItem/index.vue +9 -3
  18. package/src/components/Global/AppHeader/ModalSearch/index.vue +6 -1
  19. package/src/components/Global/AppHeader/index.stories.js +16 -24
  20. package/src/components/Global/AppHeader/index.vue +9 -8
  21. package/src/components/Global/Cookies/{index.storieshide.js → index.stories.js} +5 -16
  22. package/src/components/Global/Cookies/index.vue +122 -136
  23. package/src/components/Global/Cookies/styles.scss +10 -2
  24. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +53 -47
  25. package/src/components/Global/GlobalNotice/index.stories.js +8 -0
  26. package/src/components/Global/GlobalNotice/index.vue +71 -137
  27. package/src/components/Global/HeroHeader/styles.scss +2 -1
  28. package/src/components/Paragraphs/BrowseContent/index.stories.js +39 -57
  29. package/src/components/Paragraphs/Chart/Constants.js +4790 -0
  30. package/src/components/Paragraphs/Chart/index.mdx +61 -0
  31. package/src/components/Paragraphs/Chart/index.stories.js +31 -0
  32. package/src/components/Paragraphs/Chart/index.vue +331 -0
  33. package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +34 -39
  34. package/src/components/Paragraphs/ListGroup/list-group.stories.js +34 -31
  35. package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +33 -30
  36. package/src/components/Paragraphs/ScrollSpy/index.stories.js +18 -26
  37. package/src/components/Paragraphs/ScrollSpy/index.vue +2 -1
  38. package/src/components/Paragraphs/TaskFinder/index.stories.js +10 -33
  39. package/src/components/Paragraphs/TaskFinder/pdf/index.vue +1 -1
  40. package/src/components/Paragraphs/TextMedia/index.stories.js +12 -61
  41. package/src/components/Paragraphs/VideoGrid/index.stories.js +16 -32
  42. package/src/components/SubComponents/FormInstance/index.vue +3 -1
  43. package/src/components/SubComponents/FormInstance/stories/mocks/checkbox.json +21 -0
  44. package/src/components/SubComponents/Search/GoogleREST/index.stories.js +50 -0
  45. package/src/components/SubComponents/Search/GoogleSearch/index.stories.js +23 -0
  46. package/src/components/SubComponents/Search/SearchListing/index.vue +69 -9
  47. package/src/components/SubComponents/Search/index.stories.js +19 -16
  48. package/src/components/SubComponents/Search/index.vue +563 -59
  49. package/src/components/SubComponents/VideoThumbnail/index.stories.js +9 -4
  50. package/src/components/SubComponents/VideoThumbnail/index.vue +93 -96
  51. package/src/includes/scss/vars/src/colors.scss +29 -1
  52. package/src/index.js +42 -40
  53. package/vite.config.js +5 -1
  54. package/src/components/SubComponents/GoogleSearch/index.stories.js +0 -8
  55. package/src/components/SubComponents/GoogleSearch/index.vue +0 -405
@@ -17,12 +17,14 @@
17
17
  </div>
18
18
  </div>
19
19
  </column>
20
+ <!-- Cookie buttons displayed when not xs -->
20
21
  <column class="cookie-container__col hidden-on-xs">
21
22
  <div class="cookie-buttons mt-md-3">
22
23
  <button
23
24
  id="moreBtn"
24
- v-b-modal.cookieModal
25
+ type="button"
25
26
  role="button"
27
+ @click="showCookieModal = !showCookieModal"
26
28
  class="cookieBtn moreOptions"
27
29
  aria-label="More cookie options"
28
30
  >
@@ -34,10 +36,7 @@
34
36
  class="cookieBtn yellow hasIcon"
35
37
  style="order:1;"
36
38
  aria-label="Accept all cookies"
37
- @click="
38
- clickedCookie('accept')
39
- fireGTM()
40
- "
39
+ @click="clickedCookie('accept'), fireGTM()"
41
40
  >
42
41
  Accept all
43
42
  </button>
@@ -47,162 +46,148 @@
47
46
  class="cookieBtn black hasIcon"
48
47
  style="order:2;"
49
48
  aria-label="Reject all cookies"
50
- @click="
51
- clickedCookie('reject')
52
- fireGTM()
53
- checkCookie()
54
- "
49
+ @click="clickedCookie('reject'), fireGTM(), checkCookie()"
55
50
  >
56
51
  Reject all
57
52
  </button>
58
53
  </div>
59
54
  </column>
55
+ <!-- Cookie buttons displayed when xs -->
60
56
  <row class="cookie-links col mt-3 display-on-xs">
61
57
  <div>
62
- <a id="moreLink" href="#" @click="$bvModal.show('cookieModal')"
58
+ <a id="moreLink" href="#" @click="showCookieModal = !showCookieModal"
63
59
  >More options</a
64
60
  >
65
61
  <a
66
62
  id="acceptAllLink"
67
63
  href="#"
68
- @click="
69
- clickedCookie('accept')
70
- fireGTM()
71
- "
64
+ @click="clickedCookie('accept'), fireGTM()"
72
65
  >Accept all</a
73
66
  >
74
67
  <a
75
68
  id="rejectAllLink"
76
69
  href="#"
77
- @click="
78
- clickedCookie('reject')
79
- fireGTM()
80
- checkCookie()
81
- "
70
+ @click="clickedCookie('reject'), fireGTM(), checkCookie()"
82
71
  >Reject all</a
83
72
  >
84
73
  </div>
85
74
  </row>
86
75
  </row>
87
-
88
- <b-modal
89
- id="cookieModal"
90
- refs="cookieModal"
91
- :visible="visible"
92
- role="dialog"
93
- scrollable
94
- @hidden="reset"
95
- >
96
- <div slot="modal-title" class="modal-heading">
97
- {{ cookieContent.modal.heading }}
98
- </div>
99
- <div class="modal-content">
100
- <fieldset>
101
- <row>
102
- <column>
103
- <h5>{{ cookieContent.modal.functional.heading }}</h5>
104
- </column>
105
- <column>
106
- <label for="modal1CB" class="option"
107
- >Necessary<span class="sr-only">functional label</span>
108
- <input
109
- id="modal1CB"
110
- type="checkbox"
111
- value="functional"
112
- checked
113
- disabled
114
- /></label>
115
- </column>
116
- </row>
117
- <row>
118
- <column class="modal-description">{{
119
- cookieContent.modal.functional.description
120
- }}</column>
121
- </row>
122
- <hr />
123
- <row>
124
- <column>
125
- <h5>{{ cookieContent.modal.analytics.heading }}</h5>
126
- </column>
127
- <column>
128
- <label for="modal2CB" class="option"
129
- ><span class="sr-only">analytics checkbox</span>
130
- <input
131
- id="modal2CB"
132
- type="checkbox"
133
- name="modal2CB"
134
- value="analytics"
135
- /></label>
136
- </column>
137
- </row>
138
- <row>
139
- <column class="modal-description">{{
140
- cookieContent.modal.analytics.description
141
- }}</column>
142
- </row>
143
- <hr />
144
- <row>
145
- <column>
146
- <h5>{{ cookieContent.modal.marketing.heading }}</h5>
147
- </column>
148
- <column text-align="right">
149
- <label for="modal3CB" class="option"
150
- ><span class="sr-only">marketing checkbox</span>
151
- <input
152
- id="modal3CB"
153
- type="checkbox"
154
- name="modal3CB"
155
- value="marketing"
156
- /></label>
157
- </column>
158
- </row>
159
- <row>
160
- <column class="modal-description">{{
161
- cookieContent.modal.marketing.description
162
- }}</column>
163
- </row>
164
- </fieldset>
165
- </div>
166
- <div slot="modal-footer">
167
- <button
168
- id="modal_save"
169
- type="button"
170
- role="button"
171
- class="cookieBtn yellow hasIcon"
172
- style="order:1;"
173
- aria-label="Save cookie settings"
174
- @click="
175
- clickedCookie('save')
176
- fireGTM()
177
- checkCookie()
178
- $bvModal.hide('cookieModal')
179
- "
180
- >
181
- Save
182
- </button>
183
- <button
184
- id="modal_accept"
185
- type="button"
186
- role="button"
187
- class="cookieBtn black hasIcon"
188
- style="order:2;"
189
- data-bs-dismiss="cookieModal"
190
- aria-label="Accept all cookies"
191
- @click="
192
- clickedCookie('accept')
193
- fireGTM()
194
- $bvModal.hide('cookieModal')
195
- "
196
- >
197
- Accept all
198
- </button>
199
- </div>
200
- </b-modal>
76
+ <!-- Modal -->
77
+ <div v-if="showCookieModal" class="modal fade show" tabindex="-1" aria-modal="true" role="dialog" style="display: block;">
78
+ <div class="modal-dialog">
79
+ <div class="modal-content">
80
+ <div class="modal-header">
81
+ <div class="modal-heading-text">
82
+ {{ cookieContent.modal.heading }}
83
+ </div>
84
+ <button type="button" class="btn-close" @click="showCookieModal = !showCookieModal" aria-label="close"></button>
85
+ </div>
86
+ <div class="modal-body">
87
+ <fieldset>
88
+ <row>
89
+ <column>
90
+ <h5>{{ cookieContent.modal.functional.heading }}</h5>
91
+ </column>
92
+ <column>
93
+ <label for="modal1CB" class="option">
94
+ Necessary<span class="visually-hidden">functional label</span>
95
+ <input
96
+ id="modal1CB"
97
+ type="checkbox"
98
+ value="functional"
99
+ checked
100
+ disabled
101
+ />
102
+ </label>
103
+ </column>
104
+ </row>
105
+ <row>
106
+ <column class="modal-description">
107
+ {{cookieContent.modal.functional.description}}
108
+ </column>
109
+ </row>
110
+ <hr />
111
+ <row>
112
+ <column>
113
+ <h5>{{ cookieContent.modal.analytics.heading }}</h5>
114
+ </column>
115
+ <column>
116
+ <label for="modal2CB" class="option">
117
+ <span class="visually-hidden">analytics checkbox</span>
118
+ <input
119
+ id="modal2CB"
120
+ type="checkbox"
121
+ name="modal2CB"
122
+ value="analytics"
123
+ />
124
+ </label>
125
+ </column>
126
+ </row>
127
+ <row>
128
+ <column class="modal-description">
129
+ {{cookieContent.modal.analytics.description}}
130
+ </column>
131
+ </row>
132
+ <hr />
133
+ <row>
134
+ <column>
135
+ <h5>{{ cookieContent.modal.marketing.heading }}</h5>
136
+ </column>
137
+ <column text-align="right">
138
+ <label for="modal3CB" class="option">
139
+ <span class="visually-hidden">marketing checkbox</span>
140
+ <input
141
+ id="modal3CB"
142
+ type="checkbox"
143
+ name="modal3CB"
144
+ value="marketing"
145
+ />
146
+ </label>
147
+ </column>
148
+ </row>
149
+ <row>
150
+ <column class="modal-description">
151
+ {{cookieContent.modal.marketing.description}}
152
+ </column>
153
+ </row>
154
+ </fieldset>
155
+ </div>
156
+ <div class="modal-footer">
157
+ <button
158
+ id="modal_save"
159
+ type="button"
160
+ role="button"
161
+ class="cookieBtn yellow hasIcon"
162
+ style="order:1;"
163
+ aria-label="Save cookie settings"
164
+ @click="clickedCookie('save'), fireGTM(), checkCookie(), showCookieModal = !showCookieModal"
165
+ >
166
+ Save
167
+ </button>
168
+ <button
169
+ id="modal_accept"
170
+ type="button"
171
+ role="button"
172
+ class="cookieBtn black hasIcon"
173
+ style="order:2;"
174
+ data-bs-dismiss="cookieModal"
175
+ aria-label="Accept all cookies"
176
+ @click="clickedCookie('accept'), fireGTM(), showCookieModal = !showCookieModal"
177
+ >
178
+ Accept all
179
+ </button>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
201
184
  </container>
202
185
  </template>
203
186
 
204
187
  <script>
205
- import { Container, Row, Column } from '../../../index.vue'
188
+ import Container from './../../Containers/Container/index.vue'
189
+ import Row from './../../Containers/Row/index.vue'
190
+ import Column from './../../Containers/Column/index.vue'
206
191
  import { analyticsCookies, marketingCookies } from './Constants'
207
192
 
208
193
  export default {
@@ -227,7 +212,8 @@ export default {
227
212
  modalTitle: this.modalHeading,
228
213
  analyticsCookies,
229
214
  marketingCookies,
230
- screenWidth: 0
215
+ screenWidth: 0,
216
+ showCookieModal: false
231
217
  }
232
218
  },
233
219
  computed: {
@@ -1,5 +1,5 @@
1
1
  @import '../../../assets/styles/generated-icons.scss';
2
- @import '../../../includes/scss/all';
2
+ @import './../../../includes/scss/all';
3
3
 
4
4
  h3.cookie-header {
5
5
  font-weight: 700;
@@ -249,7 +249,15 @@ h3.cookie-header {
249
249
  color: $black;
250
250
  }
251
251
 
252
- .modal-heading {
252
+ .modal {
253
+ background: rgba(0,0,0,0.5)
254
+ }
255
+
256
+ .modal-backdrop {
257
+ display: none;
258
+ }
259
+
260
+ .modal-heading-text {
253
261
  font-size: 26px;
254
262
  font-weight: 700;
255
263
  line-height: 32px;
@@ -4,62 +4,58 @@
4
4
  :has-caret="true"
5
5
  :selected="numberOfItems > 0"
6
6
  :is-reset="false"
7
- @clicked="$bvModal.show(`modal-center-${_uid}`)"
7
+ @clicked="showMyModal = !showMyModal"
8
8
  >
9
9
  <span>{{ data.name }}</span>
10
10
  <span v-if="numberOfItems > 0">({{ numberOfItems }})</span>
11
11
  </filter-button>
12
- <b-modal
13
- :id="`modal-center-${_uid}`"
14
- modal-class="wcl-directory-filters__single-tax__modal"
15
- centered
16
- scrollable
17
- size="xl"
18
- :title="data.name"
19
- :title-sr-only="true"
20
- header-close-label="Close dialog box"
21
- >
22
- <fieldset>
23
- <legend>Filter by {{ data.name }}</legend>
24
- <div v-for="term in data.terms" :key="term.tid" class="option">
25
- <input
26
- :id="`term_${term.tid}`"
27
- v-model="selectedFilters[`${data.record_id}`]"
28
- type="checkbox"
29
- :name="term.name"
30
- :value="term"
31
- :disabled="term.preselected"
32
- @keyup.enter="(e) => e.target.click()"
33
- />
34
- <label :for="`term_${term.tid}`">{{ term.name }}</label>
12
+ <div v-if="showMyModal" class="modal fade show wcl-directory-filters__single-tax__modal"
13
+ tabindex="-1" aria-labelledby="exampleModalLabel" aria-modal="true" role="dialog"
14
+ style="display: block;">
15
+ <div class="modal-dialog modal-xl modal-dialog-scrollable modal-dialog-centered">
16
+ <div class="modal-content">
17
+ <div class="modal-body">
18
+ <fieldset>
19
+ <legend>Filter by {{ data.name }}</legend>
20
+ <div v-for="term in data.terms" :key="term.tid" class="option">
21
+ <input
22
+ :id="`term_${term.tid}`"
23
+ v-model="selectedFilters[`${data.record_id}`]"
24
+ type="checkbox"
25
+ :name="term.name"
26
+ :value="term"
27
+ :disabled="term.preselected"
28
+ @keyup.enter="(e) => e.target.click()"
29
+ />
30
+ <label :for="`term_${term.tid}`">{{ term.name }}</label>
31
+ </div>
32
+ </fieldset>
33
+ </div>
34
+ <div class="modal-footer">
35
+ <cta-button
36
+ v-if="!loading && results !== 0"
37
+ :type="'dark'"
38
+ :rtl="false"
39
+ :focus-outline="'light'"
40
+ :workwell="false"
41
+ @clicked="showMyModal = !showMyModal"
42
+ >Show <span>{{ results }}</span> {{ resultString }}
43
+ </cta-button>
44
+ <strong v-else><span v-show="!loading">No results found</span></strong>
45
+ </div>
35
46
  </div>
36
- </fieldset>
37
- <template #modal-footer="{ ok }">
38
- <!-- Emulate built in modal footer ok and cancel button actions -->
39
- <cta-button
40
- v-if="!loading && results !== 0"
41
- :type="'dark'"
42
- :rtl="false"
43
- :focus-outline="'light'"
44
- :workwell="false"
45
- @clicked="ok()"
46
- >Show <span>{{ results }}</span> {{ resultString }}</cta-button
47
- >
48
- <strong v-else><span v-show="!loading">No results found</span></strong>
49
- </template>
50
- </b-modal>
47
+ </div>
48
+ </div>
51
49
  </div>
52
50
  </template>
53
51
  <script>
54
- import CtaButton from './../../../SubComponents/CtaButton/index.vue'
55
- import FilterButton from './../../../Common/FilterButton/index.vue'
56
- import { BModal } from 'bootstrap-vue-next'
52
+ import CtaButton from '../../../SubComponents/CtaButton/index.vue'
53
+ import FilterButton from '../../../Common/FilterButton/index.vue'
57
54
 
58
55
  export default {
59
56
  components: {
60
57
  CtaButton,
61
- FilterButton,
62
- BModal
58
+ FilterButton
63
59
  },
64
60
  props: {
65
61
  data: {
@@ -82,7 +78,8 @@ export default {
82
78
  (term) => term.preselected
83
79
  )
84
80
  },
85
- hasReset: false
81
+ hasReset: false,
82
+ showMyModal: false
86
83
  }
87
84
  },
88
85
  computed: {
@@ -92,7 +89,7 @@ export default {
92
89
  resultString() {
93
90
  let s = 's'
94
91
  this.results === 1 ? (s = '') : false
95
- return 'Result' + s
92
+ return 'Result' + s + ' '
96
93
  }
97
94
  },
98
95
  watch: {
@@ -121,7 +118,7 @@ export default {
121
118
  }
122
119
  </script>
123
120
  <style lang="scss">
124
- //
121
+ //
125
122
  // Global non scoped scss!
126
123
  // Modal inner overrides only
127
124
  //
@@ -134,13 +131,22 @@ export default {
134
131
  padding-left: 8px;
135
132
  }
136
133
 
134
+ .modal {
135
+ background: rgba(0,0,0,0.5);
136
+ }
137
+ .modal-backdrop {
138
+ display: none;
139
+ }
140
+
137
141
  &__modal {
138
142
  .modal-content {
139
143
  border-radius: 8px;
140
144
  }
145
+
141
146
  .modal-xl {
142
147
  max-width: 920px;
143
148
  }
149
+
144
150
  .modal-header {
145
151
  position: absolute;
146
152
  width: 100%;
@@ -0,0 +1,8 @@
1
+ import GlobalNotice from './index.vue'
2
+
3
+ export default {
4
+ title: 'Global/GlobalNotice',
5
+ component: GlobalNotice
6
+ }
7
+
8
+ export const Default = {}