@worksafevictoria/wcl7.5 1.17.0-beta.1 → 1.17.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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/assets/icons/chevron-right-icon.svg +14 -0
  3. package/src/assets/icons/notepad.svg +93 -0
  4. package/src/assets/icons/question.svg +7 -0
  5. package/src/components/Common/CardGrid/index.vue +83 -74
  6. package/src/components/Common/CardGridItem/index.vue +31 -4
  7. package/src/components/Containers/Carousel/index.vue +6 -0
  8. package/src/components/Containers/SectionGroup/index.stories.js +28 -27
  9. package/src/components/Containers/SectionGroup/index.vue +6 -0
  10. package/src/components/Global/AppHeaderNew/index.vue +9 -1
  11. package/src/components/Global/AppHeaderNew/mobile.scss +5 -2
  12. package/src/components/Global/AppHeaderNew/styles.scss +6 -5
  13. package/src/components/Global/HeroHeader/index.vue +74 -57
  14. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +68 -60
  15. package/src/components/Paragraphs/Calculator/index.vue +24 -22
  16. package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +133 -0
  17. package/src/components/Paragraphs/RTWPlanner/Constants.js +433 -0
  18. package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +32 -0
  19. package/src/components/Paragraphs/RTWPlanner/{NavBar → Header}/index.vue +20 -9
  20. package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +72 -0
  21. package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +220 -0
  22. package/src/components/Paragraphs/RTWPlanner/index.stories.js +79 -15
  23. package/src/components/Paragraphs/RTWPlanner/index.vue +99 -31
  24. package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +31 -11
  25. package/src/components/Paragraphs/SelectableCards/cardbody.vue +9 -10
  26. package/src/components/Paragraphs/SelectableCards/cardtop.vue +23 -16
  27. package/src/components/Paragraphs/SelectableCards/index.stories.js +29 -8
  28. package/src/components/Paragraphs/SelectableCards/index.vue +124 -50
  29. package/src/components/Paragraphs/TextMedia/index.vue +4 -0
  30. package/src/components/Paragraphs/VideoPlayer/index.vue +1 -1
  31. package/src/components/SubComponents/Breadcrumb/index.vue +40 -7
  32. package/src/components/SubComponents/FormInstance/services/logic-parser.js +44 -12
  33. package/src/components/SubComponents/ResourceGroup/index.vue +1 -1
  34. package/src/includes/scss/vars/src/colors.module.scss +3 -0
  35. package/src/includes/scss/vars/src/colors.scss +3 -0
  36. package/src/mock/control-selectable-cards.js +68 -25
  37. package/src/components/Paragraphs/RTWPlanner/Home/index.vue +0 -83
@@ -0,0 +1,220 @@
1
+ <script setup>
2
+ import { ref, watch } from 'vue'
3
+ import HeroHeader from './../../../Global/HeroHeader/index.vue'
4
+ import CardContainer from './../CardContainer/index.vue'
5
+ import Breakout from './../../Breakout/index.vue'
6
+ import SectionGroup from './../../../Containers/SectionGroup/index.vue'
7
+ import CardGroup from './../../../SubComponents/CardGroup/index.vue'
8
+ import Breadcrumb from './../../../SubComponents/Breadcrumb/index.vue'
9
+ import RichText from './../../RichText/index.vue'
10
+ import SelectableCards from './../../SelectableCards/index.vue'
11
+
12
+ const props = defineProps({
13
+ injuryPage: {
14
+ type: String,
15
+ default: null,
16
+ },
17
+ titles: {
18
+ type: Object,
19
+ default: () => {},
20
+ },
21
+ heroHeader: {
22
+ type: Object,
23
+ default: () => {},
24
+ },
25
+ cards: {
26
+ type: Array,
27
+ default: () => [],
28
+ },
29
+ breakout: {
30
+ type: Object,
31
+ default: () => {},
32
+ },
33
+ rtwCards: {
34
+ type: Array,
35
+ default: () => [],
36
+ },
37
+ contactCards: {
38
+ type: Array,
39
+ default: () => [],
40
+ },
41
+ breadcrumbItems: {
42
+ type: Array,
43
+ default: () => [],
44
+ },
45
+ })
46
+
47
+ const screen = ref(1)
48
+ const selectedCard = ref(null)
49
+
50
+ // local copy of breadcrumb items allowed to mutate
51
+ const breadcrumbItemsLocal = ref([...props.breadcrumbItems])
52
+
53
+ // keep local in sync with incoming props when we're on screen 1
54
+ watch(
55
+ () => props.breadcrumbItems,
56
+ (val) => {
57
+ if (screen.value === 1) {
58
+ breadcrumbItemsLocal.value = [...val]
59
+ }
60
+ },
61
+ { immediate: true },
62
+ )
63
+
64
+ function nextScreen(card) {
65
+ selectedCard.value = card
66
+ screen.value = 2
67
+
68
+ if (props.injuryPage === 'physicalInjury') {
69
+ breadcrumbItemsLocal.value = [
70
+ {
71
+ text: 'Physical Injury',
72
+ to: '/',
73
+ },
74
+ ]
75
+ }
76
+ }
77
+
78
+ function onCrumbClick({ index }) {
79
+ // clicking the first crumb → back to screen 1
80
+ if (index === 0) {
81
+ screen.value = 1
82
+ selectedCard.value = null
83
+ breadcrumbItemsLocal.value = [...props.breadcrumbItems]
84
+ }
85
+
86
+ // if you want the second crumb clickable to stay on screen 2,
87
+ // you can add logic for index === 1 here, or just leave it as no-op.
88
+ }
89
+
90
+ function nextScreenAgent() {}
91
+ </script>
92
+
93
+ <template>
94
+ <div class="injuries-app">
95
+ <breadcrumb
96
+ :breadcrumb-items="breadcrumbItemsLocal"
97
+ :intercept-clicks="true"
98
+ @item-click="onCrumbClick"
99
+ />
100
+
101
+ <div v-if="injuryPage === 'physicalInjury' && screen === 1">
102
+ <hero-header
103
+ :image="null"
104
+ :show-mask="false"
105
+ :title="heroHeader.title"
106
+ :description="heroHeader.description"
107
+ :bg-color="null"
108
+ :show-social="false"
109
+ class="hero-header"
110
+ />
111
+ <breakout :title="breakout.title" :body="breakout.body" />
112
+
113
+ <card-container
114
+ ref="physicalCardContainer"
115
+ :titles="titles.physical"
116
+ :cards="cards"
117
+ :button-role="'modal-quest'"
118
+ @nextScreen="nextScreen"
119
+ />
120
+ </div>
121
+
122
+ <div
123
+ v-if="
124
+ injuryPage === 'mentalInjury' ||
125
+ injuryPage === 'otherInjury' ||
126
+ screen === 2
127
+ "
128
+ >
129
+ <section-group
130
+ v-if="selectedCard?.value || cards.content"
131
+ :background-variant="'lavendergray'"
132
+ class="injuries-app__injury"
133
+ >
134
+ <rich-text
135
+ :content="selectedCard?.value || cards.content"
136
+ :without-container="true"
137
+ />
138
+ </section-group>
139
+
140
+ <card-group
141
+ v-if="rtwCards.length > 0"
142
+ class="injuries-app__rtw-cards"
143
+ :title="titles.rtwCards?.heading"
144
+ :title-tag="'h3'"
145
+ :cards="rtwCards"
146
+ :loading="false"
147
+ :columns="3"
148
+ :show-load-more="false"
149
+ :background="'white'"
150
+ />
151
+
152
+ <selectable-cards
153
+ class="injuries-app__contact-info"
154
+ :title="titles.cardContactInformaton?.heading"
155
+ :button-role="'none'"
156
+ :columns-per-row="4"
157
+ :cards="contactCards"
158
+ :icon-is-bordered="false"
159
+ :card-type="'control-selectcards'"
160
+ :card-text-align="'center'"
161
+ :is-selectable="'false'"
162
+ ></selectable-cards>
163
+ </div>
164
+
165
+ <div v-if="injuryPage === 'selectAgent'">
166
+ <card-container
167
+ ref="selectAgentContainer"
168
+ :columns="4"
169
+ :title="titles.cardContactInformaton?.heading"
170
+ :cards="contactCards"
171
+ :button-role="'link'"
172
+ @nextScreen="nextScreenAgent"
173
+ />
174
+ </div>
175
+ </div>
176
+ </template>
177
+
178
+ <style lang="scss" scoped>
179
+ .injuries-app {
180
+ .wcl-hero-header {
181
+ border: none;
182
+ }
183
+
184
+ .wcl-breadcrumb {
185
+ margin: 50px 0 20px 0;
186
+ :deep(.breadcrumb) {
187
+ font-size: 12px;
188
+ }
189
+
190
+ &--ltr {
191
+ :deep(.breadcrumb-item:first-of-type::before) {
192
+ content: '<';
193
+ margin-right: 10px;
194
+ }
195
+ }
196
+ }
197
+
198
+ &__injury {
199
+ border-radius: 8px !important;
200
+ :deep(a.cta-button) {
201
+ display: none;
202
+ }
203
+ }
204
+
205
+ &__rtw-cards {
206
+ @media (min-width: 1024px) {
207
+ :deep(.section-group__heading) {
208
+ width: 75%;
209
+ }
210
+ }
211
+ }
212
+
213
+ &__contact-info {
214
+ :deep(.card-unit) {
215
+ padding: 0;
216
+ font-weight: bold;
217
+ }
218
+ }
219
+ }
220
+ </style>
@@ -1,26 +1,90 @@
1
1
  import RTWPlanner from './index.vue'
2
-
3
- const textMedia = {
4
- title: 'Return to Work Planner',
5
- content:
6
- '<p>An easy-to-use online guide that steps employers through the return to work process and meeting legal obligations for non major injuries.</p>',
7
- image: {
8
- url:
9
- process.env.CONTENT_API_URL +
10
- '/sites/default/files/2020-04/Topic-Coronavirus-COVID-19.jpg',
11
- alt: 'Some alt text',
12
- },
13
- rtl: true,
14
- titleTag: 'h1',
15
- }
2
+ import {
3
+ textMedia,
4
+ selectInjuries,
5
+ heroHeader,
6
+ cardTitles,
7
+ cardPhysicalBreakout,
8
+ cardPhysical,
9
+ cardRTWCards,
10
+ cardContactInformaton,
11
+ cardRTWMentalCards,
12
+ cardRTWOtherCards,
13
+ cardAgentContactInformaton,
14
+ } from './Constants'
16
15
 
17
16
  export default {
18
17
  title: 'Paragraphs/RTWPlanner',
19
18
  component: RTWPlanner,
20
19
  tags: ['autodocs'],
20
+ argTypes: {
21
+ homePage: {
22
+ control: 'boolean',
23
+ table: { disable: true },
24
+ },
25
+ injuryPage: {
26
+ type: String,
27
+ default: null,
28
+ },
29
+ },
30
+ }
31
+
32
+ export const ReturnToWork = {
21
33
  args: {
34
+ homePage: true,
22
35
  textMedia: textMedia,
36
+ selectInjuries: selectInjuries,
23
37
  },
24
38
  }
25
39
 
26
- export const ReturnToWork = {}
40
+ export const PhysicalInjury = {
41
+ args: {
42
+ breadcrumbItems: [{ text: 'Nature of the injury', to: '/' }],
43
+ homePage: false,
44
+ injuryPage: 'physicalInjury',
45
+ titles: cardTitles,
46
+ heroHeader: heroHeader,
47
+ cards: cardPhysical,
48
+ breakout: cardPhysicalBreakout,
49
+ rtwCards: cardRTWCards,
50
+ contactCards: cardContactInformaton,
51
+ },
52
+ }
53
+
54
+ export const Mentalnjury = {
55
+ args: {
56
+ breadcrumbItems: [{ text: 'Mental Injury', to: '/' }],
57
+ homePage: false,
58
+ injuryPage: 'mentalInjury',
59
+ titles: cardTitles,
60
+ heroHeader: heroHeader,
61
+ cards: selectInjuries.mental,
62
+ breakout: cardPhysicalBreakout,
63
+ rtwCards: cardRTWMentalCards,
64
+ contactCards: cardContactInformaton,
65
+ },
66
+ }
67
+
68
+ export const Otherlnjury = {
69
+ args: {
70
+ breadcrumbItems: [{ text: 'Injury', to: '/' }],
71
+ homePage: false,
72
+ injuryPage: 'otherInjury',
73
+ titles: cardTitles,
74
+ heroHeader: heroHeader,
75
+ cards: selectInjuries.other,
76
+ breakout: cardPhysicalBreakout,
77
+ rtwCards: cardRTWOtherCards,
78
+ contactCards: cardContactInformaton,
79
+ },
80
+ }
81
+
82
+ export const SelectYourAgent = {
83
+ args: {
84
+ breadcrumbItems: [{ text: 'Physical Injury', to: '/' }],
85
+ homePage: false,
86
+ injuryPage: 'selectAgent',
87
+ titles: cardTitles,
88
+ contactCards: cardAgentContactInformaton,
89
+ },
90
+ }
@@ -1,41 +1,109 @@
1
+ <script setup>
2
+ import SectionGroup from './../../Containers/SectionGroup/index.vue'
3
+ import Header from './Header/index.vue'
4
+ import HomePage from './HomePage/index.vue'
5
+ import Injuries from './Injuries/index.vue'
6
+ import Footer from './Footer/index.vue'
7
+
8
+ const props = defineProps({
9
+ homePage: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
13
+ injuryPage: {
14
+ type: String,
15
+ default: null,
16
+ },
17
+ textMedia: {
18
+ type: Object,
19
+ required: true,
20
+ },
21
+ selectInjuries: {
22
+ type: Object,
23
+ required: true,
24
+ },
25
+ titles: {
26
+ type: Object,
27
+ default: () => {},
28
+ },
29
+ heroHeader: {
30
+ type: Object,
31
+ default: () => {},
32
+ },
33
+ cards: {
34
+ type: Array,
35
+ default: () => [],
36
+ },
37
+ breakout: {
38
+ type: Object,
39
+ default: () => {},
40
+ },
41
+ rtwCards: {
42
+ type: Array,
43
+ default: () => [],
44
+ },
45
+ contactCards: {
46
+ type: Array,
47
+ default: () => [],
48
+ },
49
+ breadcrumbItems: {
50
+ type: Array,
51
+ default: () => [],
52
+ },
53
+ })
54
+ </script>
55
+
1
56
  <template>
2
57
  <section-group
3
58
  backgroundVariant="white"
4
59
  size="page"
5
60
  applyBackgroundOn="container"
61
+ class="rtw-app"
6
62
  >
7
- <NavBar />
8
-
9
- <div>
10
- <!-- ✅ forward the prop -->
11
- <Home :textMedia="textMedia" />
12
- </div>
13
-
14
- <div class="d-flex justify-content-end gap-3 my-4 small fw-bold">
15
- <a href="/return-work-help">Help</a>
16
- <a href="/return-work-faq">FAQs</a>
17
- <a href="/return-work-privacy">Privacy Policy</a>
18
- </div>
63
+ <Header />
64
+
65
+ <!-- ✅ forward the prop -->
66
+ <HomePage
67
+ v-if="homePage"
68
+ :textMedia="textMedia"
69
+ :selectInjuries="selectInjuries"
70
+ />
71
+
72
+ <Injuries
73
+ v-if="!homePage"
74
+ :breadcrumbItems="breadcrumbItems"
75
+ :injuryPage="injuryPage"
76
+ :titles="titles"
77
+ :heroHeader="heroHeader"
78
+ :cards="cards"
79
+ :breakout="breakout"
80
+ :rtwCards="rtwCards"
81
+ :contactCards="contactCards"
82
+ />
83
+
84
+ <Footer />
19
85
  </section-group>
20
86
  </template>
21
87
 
22
- <script>
23
- import SectionGroup from './../../Containers/SectionGroup/index.vue'
24
- import NavBar from './NavBar/index.vue'
25
- import Home from './Home/index.vue'
26
-
27
- export default {
28
- name: 'RTWPlanner',
29
- components: {
30
- SectionGroup,
31
- NavBar,
32
- Home,
33
- },
34
- props: {
35
- textMedia: {
36
- type: Object,
37
- default: () => ({}),
38
- },
39
- },
88
+ <style lang="scss" scoped>
89
+ .rtw-app {
90
+ &__footer {
91
+ border-top: 1px solid #bababa;
92
+ padding: 20px 0;
93
+
94
+ a {
95
+ color: black;
96
+ font-size: 16px;
97
+ font-style: normal;
98
+ font-weight: 700;
99
+ line-height: 20px;
100
+ letter-spacing: 0px;
101
+ margin-left: 20px;
102
+ }
103
+ }
104
+
105
+ :deep(.wcl-media-text__content) {
106
+ padding-left: 20px;
107
+ }
40
108
  }
41
- </script>
109
+ </style>
@@ -1,5 +1,8 @@
1
1
  import SelectableCards from './../index.vue'
2
- import { mockSelectableCards } from '../../../../mock/control-selectable-cards'
2
+ import {
3
+ mockSelectableCards,
4
+ mockModalSelectableCards,
5
+ } from '../../../../mock/control-selectable-cards'
3
6
 
4
7
  export default {
5
8
  title: 'Paragraphs/SelectableCards',
@@ -7,24 +10,41 @@ export default {
7
10
  tags: ['autodocs'],
8
11
  argTypes: {
9
12
  cardType: {
10
- table: { disable: true }
13
+ table: { disable: true },
11
14
  },
12
15
  cardTextAlign: {
13
- table: { disable: true }
14
- }
16
+ table: { disable: true },
17
+ },
15
18
  },
19
+ template:
20
+ '<selectable-cards v-bind="args" class="control-selectablecards" />',
21
+ }
22
+
23
+ export const Control = {
16
24
  args: {
17
25
  cards: mockSelectableCards,
18
26
  title: 'Pick an object?',
19
27
  headingTag: 'h2',
20
- subHeading: 'Pick an object from the selections or if you know exactly how heavy is the object that is being dropped, enter the height in input box below.',
28
+ subHeading:
29
+ 'Pick an object from the selections or if you know exactly how heavy is the object that is being dropped, enter the height in input box below.',
21
30
  iconIsBordered: false,
22
31
  columns: 4,
23
32
  cardType: 'control-selectcards',
24
- cardTextAlign: 'center'
25
- },
26
- template:
27
- '<selectable-cards v-bind="args" class="control-selectablecards" />'
28
- }
33
+ cardTextAlign: 'center',
34
+ },
35
+ }
29
36
 
30
- export const Control = {}
37
+ export const Modal = {
38
+ args: {
39
+ cards: mockModalSelectableCards,
40
+ title: 'The following physical injury types are not supported',
41
+ headingTag: 'h2',
42
+ subHeading:
43
+ '<p>If you have multiple conditions apply, please select the most severe condition.</p>',
44
+ iconIsBordered: false,
45
+ columns: 4,
46
+ cardType: 'control-selectcards',
47
+ cardTextAlign: 'center',
48
+ buttonRole: 'modal-quest',
49
+ },
50
+ }
@@ -1,17 +1,16 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ card: {
4
+ type: Object,
5
+ required: true,
6
+ },
7
+ })
8
+ </script>
9
+
1
10
  <template>
2
11
  <p v-if="card.value" class="card-unit">{{ card.value }} {{ card.units }}</p>
3
12
  </template>
4
13
 
5
- <script>
6
- export default {
7
- props: {
8
- card: {
9
- type: Object,
10
- required: true
11
- }
12
- }
13
- }
14
- </script>
15
14
  <style lang="scss" scoped>
16
15
  .card-unit {
17
16
  margin: 0;
@@ -4,42 +4,49 @@
4
4
  v-if="card.pillText"
5
5
  class="card_item__pillTop pillTop"
6
6
  :class="{
7
- [`card_item__pillTop--rtl-${!!card.rtl}`]: true
7
+ [`card_item__pillTop--rtl-${!!card.rtl}`]: true,
8
8
  }"
9
9
  aria-hidden="true"
10
10
  >
11
11
  {{ card.pillText }}
12
12
  </div>
13
+
13
14
  <div class="card_item__pillTop pillTopText card_item__pillTop--rtl-true">
14
15
  <label
15
16
  class="card_item__control"
16
17
  :class="{ [`card_item__control-${buttonRole}`]: true }"
17
- ><span></span
18
- ></label>
18
+ @click.stop="buttonRoleClicked"
19
+ >
20
+ <span></span>
21
+ </label>
19
22
  </div>
23
+
20
24
  <div class="card_item__spacer card_item__spacer--withTextOnly"></div>
21
25
  </div>
22
26
  </template>
23
27
 
24
28
  <script>
25
29
  export default {
26
- components: {},
30
+ name: 'CardTop',
31
+ emits: {
32
+ 'button-role-clicked': false,
33
+ },
27
34
  props: {
28
- card: {
29
- type: Object,
30
- required: true
31
- },
32
- buttonRole: {
33
- type: String,
34
- default: 'radio'
35
+ card: { type: Object, required: true },
36
+ buttonRole: { type: String, default: 'radio' },
37
+ isSelectable: { type: Boolean, default: false },
38
+ },
39
+ methods: {
40
+ buttonRoleClicked() {
41
+ if (this.isSelectable) {
42
+ // Emit the raw card object (no wrapper, no stringify)
43
+ this.$emit('button-role-clicked', this.card)
44
+ }
35
45
  },
36
- isSelectable: {
37
- type: Boolean,
38
- default: false
39
- }
40
- }
46
+ },
41
47
  }
42
48
  </script>
49
+
43
50
  <style lang="scss" scoped>
44
51
  @import '../../../includes/scss/all';
45
52
  $borderRadius: 8px;
@@ -6,22 +6,43 @@ export default {
6
6
  component: SelectableCards,
7
7
  argTypes: {
8
8
  cardType: {
9
- table: { disable: true }
9
+ table: { disable: true },
10
10
  },
11
11
  cardTextAlign: {
12
- table: { disable: true }
12
+ table: { disable: true },
13
13
  },
14
14
  iconIsBordered: {
15
- table: { disable: true }
16
- }
15
+ table: { disable: true },
16
+ },
17
+ buttonRole: {
18
+ type: String,
19
+ default: 'link',
20
+ },
17
21
  },
22
+ }
23
+
24
+ export const Default = {
18
25
  args: {
19
26
  cards: mockSelectableCards,
20
27
  title: 'Selectable cards',
21
28
  headingTag: 'h2',
22
29
  columns: 4,
23
- subHeading: null
24
- }
25
- }
30
+ subHeading: null,
31
+ buttonRole: 'link',
32
+ },
33
+ }
26
34
 
27
- export const Default = {}
35
+ export const Simple = {
36
+ args: {
37
+ cards: mockSelectableCards,
38
+ title: 'Agent contact information',
39
+ headingTag: 'h2',
40
+ columns: 4,
41
+ subHeading: null,
42
+ iconIsBordered: false,
43
+ cardType: 'control-selectcards',
44
+ isSelectable: false,
45
+ buttonRole: 'none',
46
+ cardTextAlign: 'center',
47
+ },
48
+ }