@worksafevictoria/wcl7.5 1.17.0-beta.3 → 1.17.0-beta.4

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/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/SectionGroup/index.stories.js +28 -27
  8. package/src/components/Containers/SectionGroup/index.vue +6 -0
  9. package/src/components/Global/HeroHeader/index.vue +74 -57
  10. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +68 -60
  11. package/src/components/Paragraphs/Calculator/index.vue +24 -22
  12. package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +133 -0
  13. package/src/components/Paragraphs/RTWPlanner/Constants.js +410 -0
  14. package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +32 -0
  15. package/src/components/Paragraphs/RTWPlanner/{NavBar → Header}/index.vue +20 -9
  16. package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +72 -0
  17. package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +174 -0
  18. package/src/components/Paragraphs/RTWPlanner/index.stories.js +68 -15
  19. package/src/components/Paragraphs/RTWPlanner/index.vue +99 -31
  20. package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +31 -11
  21. package/src/components/Paragraphs/SelectableCards/cardbody.vue +9 -10
  22. package/src/components/Paragraphs/SelectableCards/cardtop.vue +23 -16
  23. package/src/components/Paragraphs/SelectableCards/index.stories.js +29 -8
  24. package/src/components/Paragraphs/SelectableCards/index.vue +124 -50
  25. package/src/components/SubComponents/Breadcrumb/index.vue +40 -7
  26. package/src/includes/scss/vars/src/colors.module.scss +3 -0
  27. package/src/includes/scss/vars/src/colors.scss +3 -0
  28. package/src/mock/control-selectable-cards.js +68 -25
  29. package/src/components/Paragraphs/RTWPlanner/Home/index.vue +0 -83
@@ -0,0 +1,174 @@
1
+ <script setup>
2
+ import { ref } 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
+ function nextScreen(card) {
51
+ selectedCard.value = card
52
+ screen.value = 2
53
+ }
54
+
55
+ function onCrumbClick({ item, index, event }) {
56
+ screen.value = 1
57
+ }
58
+ </script>
59
+
60
+ <template>
61
+ <div class="injuries-app">
62
+ <div v-if="injuryPage === 'physicalInjury' && screen === 1">
63
+ <hero-header
64
+ :image="null"
65
+ :show-mask="false"
66
+ :title="heroHeader.title"
67
+ :description="heroHeader.description"
68
+ :bg-color="null"
69
+ :show-social="false"
70
+ class="hero-header"
71
+ />
72
+ <breakout :title="breakout.title" :body="breakout.body" />
73
+
74
+ <card-container
75
+ ref="physicalCardContainer"
76
+ :titles="titles.physical"
77
+ :cards="cards"
78
+ :button-role="'modal-quest'"
79
+ @nextScreen="nextScreen"
80
+ />
81
+ </div>
82
+
83
+ <div
84
+ v-if="
85
+ injuryPage === 'mentalInjury' ||
86
+ injuryPage === 'otherInjury' ||
87
+ screen === 2
88
+ "
89
+ >
90
+ <breadcrumb
91
+ :breadcrumb-items="breadcrumbItems"
92
+ :intercept-clicks="true"
93
+ @item-click="onCrumbClick"
94
+ />
95
+
96
+ <section-group
97
+ :background-variant="'lavendergray'"
98
+ class="injuries-app__injury"
99
+ >
100
+ <rich-text
101
+ :content="selectedCard?.value || cards.content"
102
+ :without-container="true"
103
+ />
104
+ </section-group>
105
+
106
+ <card-group
107
+ class="injuries-app__rtw-cards"
108
+ :title="titles.rtwCards?.heading"
109
+ :title-tag="'h3'"
110
+ :cards="rtwCards"
111
+ :loading="false"
112
+ :columns="3"
113
+ :show-load-more="false"
114
+ :background="'white'"
115
+ />
116
+
117
+ <selectable-cards
118
+ class="injuries-app__contact-info"
119
+ :title="titles.cardContactInformaton?.heading"
120
+ :button-role="'none'"
121
+ :columns-per-row="4"
122
+ :cards="contactCards"
123
+ :icon-is-bordered="false"
124
+ :card-type="'control-selectcards'"
125
+ :card-text-align="'center'"
126
+ :is-selectable="'false'"
127
+ ></selectable-cards>
128
+ </div>
129
+ </div>
130
+ </template>
131
+
132
+ <style lang="scss" scoped>
133
+ .injuries-app {
134
+ .wcl-hero-header {
135
+ border: none;
136
+ }
137
+
138
+ .wcl-breadcrumb {
139
+ margin: 50px 0 20px 0;
140
+ :deep(.breadcrumb) {
141
+ font-size: 12px;
142
+ }
143
+
144
+ &--ltr {
145
+ :deep(.breadcrumb-item:first-of-type::before) {
146
+ content: '<';
147
+ margin-right: 10px;
148
+ }
149
+ }
150
+ }
151
+
152
+ &__injury {
153
+ border-radius: 8px !important;
154
+ :deep(a.cta-button) {
155
+ display: none;
156
+ }
157
+ }
158
+
159
+ &__rtw-cards {
160
+ @media (min-width: 1024px) {
161
+ :deep(.section-group__heading) {
162
+ width: 75%;
163
+ }
164
+ }
165
+ }
166
+
167
+ &__contact-info {
168
+ :deep(.card-unit) {
169
+ padding: 0;
170
+ font-weight: bold;
171
+ }
172
+ }
173
+ }
174
+ </style>
@@ -1,26 +1,79 @@
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
+ } from './Constants'
16
14
 
17
15
  export default {
18
16
  title: 'Paragraphs/RTWPlanner',
19
17
  component: RTWPlanner,
20
18
  tags: ['autodocs'],
19
+ argTypes: {
20
+ homePage: {
21
+ control: 'boolean',
22
+ table: { disable: true },
23
+ },
24
+ injuryPage: {
25
+ type: String,
26
+ default: null,
27
+ },
28
+ },
29
+ }
30
+
31
+ export const ReturnToWork = {
21
32
  args: {
33
+ homePage: true,
22
34
  textMedia: textMedia,
35
+ selectInjuries: selectInjuries,
23
36
  },
24
37
  }
25
38
 
26
- export const ReturnToWork = {}
39
+ export const PhysicalInjury = {
40
+ args: {
41
+ breadcrumbItems: [{ text: 'Physical Injury', to: '/' }],
42
+ homePage: false,
43
+ injuryPage: 'physicalInjury',
44
+ titles: cardTitles,
45
+ heroHeader: heroHeader,
46
+ cards: cardPhysical,
47
+ breakout: cardPhysicalBreakout,
48
+ rtwCards: cardRTWCards,
49
+ contactCards: cardContactInformaton,
50
+ },
51
+ }
52
+
53
+ export const Mentalnjury = {
54
+ args: {
55
+ breadcrumbItems: [{ text: 'Mental Injury', to: '/' }],
56
+ homePage: false,
57
+ injuryPage: 'mentalInjury',
58
+ titles: cardTitles,
59
+ heroHeader: heroHeader,
60
+ cards: selectInjuries.mental,
61
+ breakout: cardPhysicalBreakout,
62
+ rtwCards: cardRTWMentalCards,
63
+ contactCards: cardContactInformaton,
64
+ },
65
+ }
66
+
67
+ export const Otherlnjury = {
68
+ args: {
69
+ breadcrumbItems: [{ text: 'Injury', to: '/' }],
70
+ homePage: false,
71
+ injuryPage: 'otherInjury',
72
+ titles: cardTitles,
73
+ heroHeader: heroHeader,
74
+ cards: selectInjuries.other,
75
+ breakout: cardPhysicalBreakout,
76
+ rtwCards: cardRTWOtherCards,
77
+ contactCards: cardContactInformaton,
78
+ },
79
+ }
@@ -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
+ }