toggle-components-library 1.36.0 → 1.36.1-beta.1

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.
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.36.0",
3
+ "version": "1.36.1-beta.1",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.36.0",
3
+ "version": "1.36.1-beta.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -0,0 +1,10 @@
1
+ <svg id="Group_10" data-name="Group 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="624.048" height="499" viewBox="0 0 624.048 499">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_25" data-name="Rectangle 25" width="624.048" height="499" fill="none"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Group_9" data-name="Group 9" clip-path="url(#clip-path)">
8
+ <path id="Path_3" data-name="Path 3" d="M617.3,465.069l-.384-.318c-.385-.317-.9-.738-1.674-1.49-1.419-1.279-3.616-3.309-6.36-6.112a225.664,225.664,0,0,1-20.162-23.534c-.136-.182-.271-.367-.406-.55-22.957-31.214-26.261-72.555-9.486-107.484,16.327-34,23.783-71.208,20.13-109.472C586.148,81.9,441.91-14.07,276.747,1.694S-11.9,138.983.914,273.192,157.963,503.371,323.126,487.608a364.7,364.7,0,0,0,89.545-20,77.522,77.522,0,0,1,58.556,2.224,367.136,367.136,0,0,0,38.334,14.95c29.035,9.42,63.567,16.569,96.922,13.5A19.281,19.281,0,0,0,622.561,486.8a18.785,18.785,0,0,0-5.261-21.731m-446.79-153.1A50.455,50.455,0,1,1,216.243,257.2a50.456,50.456,0,0,1-45.733,54.772m138.931-12.493a50.454,50.454,0,1,1,45.734-54.77,50.454,50.454,0,0,1-45.734,54.77m134.991-12.137a50.455,50.455,0,1,1,45.733-54.769,50.455,50.455,0,0,1-45.733,54.769" transform="translate(0 0)" fill="#477ef6"/>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg id="Group_10" data-name="Group 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="624.048" height="499" viewBox="0 0 624.048 499">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_25" data-name="Rectangle 25" width="624.048" height="499" fill="none"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Group_9" data-name="Group 9" clip-path="url(#clip-path)">
8
+ <path id="Path_3" data-name="Path 3" d="M617.3,465.069l-.384-.318c-.385-.317-.9-.738-1.674-1.49-1.419-1.279-3.616-3.309-6.36-6.112a225.664,225.664,0,0,1-20.162-23.534c-.136-.182-.271-.367-.406-.55-22.957-31.214-26.261-72.555-9.486-107.484,16.327-34,23.783-71.208,20.13-109.472C586.148,81.9,441.91-14.07,276.747,1.694S-11.9,138.983.914,273.192,157.963,503.371,323.126,487.608a364.7,364.7,0,0,0,89.545-20,77.522,77.522,0,0,1,58.556,2.224,367.136,367.136,0,0,0,38.334,14.95c29.035,9.42,63.567,16.569,96.922,13.5A19.281,19.281,0,0,0,622.561,486.8a18.785,18.785,0,0,0-5.261-21.731m-446.79-153.1A50.455,50.455,0,1,1,216.243,257.2a50.456,50.456,0,0,1-45.733,54.772m138.931-12.493a50.454,50.454,0,1,1,45.734-54.77,50.454,50.454,0,0,1-45.734,54.77m134.991-12.137a50.455,50.455,0,1,1,45.733-54.769,50.455,50.455,0,0,1-45.733,54.769" transform="translate(0 0)" fill="#354b64"/>
9
+ </g>
10
+ </svg>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <button :class="['toggle-metrics-button', buttonStyle]" @click="click">
3
- <div :class="icon"></div>
2
+ <button :class="['toggle-metrics-button', buttonStyle, 'toggle-metrics-button-' + size]" :style="styles" @click="click">
3
+ <div :class="icon" :style="styles ? 'background-color:' + styles.color : ''"></div>
4
4
  <slot>{{buttonText}}</slot>
5
5
  </button>
6
6
  </template>
@@ -19,7 +19,22 @@
19
19
  },
20
20
  icon: {
21
21
  type: String,
22
- required: true,
22
+ required: false,
23
+ validator: function(value) {
24
+ return ["heatmap-icon", "email-icon", "contacts-icon"].indexOf(value) !== -1;
25
+ }
26
+ },
27
+ size: {
28
+ type: String,
29
+ default: "medium",
30
+ required: false,
31
+ validator: function(value) {
32
+ return ["small", "medium", "large"].indexOf(value) !== -1;
33
+ }
34
+ },
35
+ styles: {
36
+ type: Object,
37
+ required: false,
23
38
  },
24
39
  },
25
40
  methods: {
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div class="toggle-comment-card">
3
+ <div class="toggle-comment-card-info" :style="{ backgroundColor: cardColor }">
4
+ <div class="toggle-comment-card-text">
5
+ <p>"{{ displayComment }}"</p>
6
+ </div>
7
+ <div class="toggle-comment-card-name">
8
+ <slot name="button_contacts"></slot>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+ <script>
14
+ export default {
15
+ data() {
16
+ return {};
17
+ },
18
+ props: {
19
+ cardIndex: {
20
+ type: Number,
21
+ required: true,
22
+ },
23
+ totalCards: {
24
+ type: Number,
25
+ required: true,
26
+ },
27
+ comment: {
28
+ type: String,
29
+ required: true,
30
+ }
31
+ },
32
+ computed: {
33
+ cardColor() {
34
+ // adjust colour palette below to change the Reward Cards colors
35
+ const colorPalette = [
36
+ "#2c7da0",
37
+ "#f3c570",
38
+ "#8bbcbe",
39
+ "#a0a789",
40
+ "#cbae78",
41
+ "#a284b6",
42
+ "#d39999",
43
+ "#9b7361",
44
+ "#64aaa8",
45
+ "#799194",
46
+ ];
47
+
48
+ // pick random number to return random index of colourPalette
49
+ const paletteIndex = Math.floor(
50
+ (this.cardIndex / this.totalCards) * colorPalette.length
51
+ );
52
+ return colorPalette[paletteIndex];
53
+ },
54
+ displayComment() {
55
+ return this.comment.length > 420 ? this.comment.substring(0, 420) + "..." : this.comment;
56
+ },
57
+ }
58
+ };
59
+ </script>
@@ -2,7 +2,9 @@
2
2
  <div>
3
3
  <h3 class="toggle-metric metric-label">{{label}}</h3>
4
4
  <div class="single-metric-icon" v-if="metricPending && label.length == 0"></div>
5
- <h1 class="toggle-metric metric-value" v-else>{{metricValue}}</h1>
5
+ <h1 class="toggle-metric metric-value" v-else>{{metricValue}}
6
+ <span v-if="score" class="toggle-metric-score-rating">/{{value.maxScore}}</span>
7
+ </h1>
6
8
  </div>
7
9
  </template>
8
10
 
@@ -21,20 +23,20 @@ export default {
21
23
  type: String,
22
24
  default: "ToggleMetricSingleMetric"
23
25
  },
24
- /**
26
+ /**
25
27
  * Type of the value, this will affect on the format shown
26
28
  */
27
29
  type : {
28
30
  type: String,
29
31
  validator: function (value) {
30
- return ['text', 'number', 'percentage', 'currency'].indexOf(value) !== -1
32
+ return ['text', 'number', 'percentage', 'currency', 'score'].indexOf(value) !== -1
31
33
  }
32
34
  },
33
35
  /**
34
36
  * Component's value
35
37
  */
36
38
  value: {
37
- type: [String, Number],
39
+ type: [String, Number, Object],
38
40
  required: true
39
41
  },
40
42
  /**
@@ -87,14 +89,17 @@ export default {
87
89
  case 'currency':
88
90
  return (this.value/this.currencyDenomination).toLocaleString(this.currencyLocale, {style: 'currency', currency: this.currencyCode});
89
91
  case'percentage':
90
- return `${this.value} %`
92
+ return `${this.value} %`;
93
+ case 'score':
94
+ return this.value.score;
91
95
  default:
92
96
  return this.value.toLocaleString();
93
97
 
94
98
  }
99
+ },
100
+ score() {
101
+ return this.type === 'score';
95
102
  }
96
-
97
-
98
103
  }
99
104
  }
100
105
 
@@ -54,14 +54,14 @@ export default {
54
54
  type : {
55
55
  type: String,
56
56
  validator: function (value) {
57
- return ['text', 'number', 'percentage', 'currency'].indexOf(value) !== -1
57
+ return ['text', 'number', 'percentage', 'currency', 'score'].indexOf(value) !== -1
58
58
  }
59
59
  },
60
60
  /**
61
61
  * single metric component value
62
62
  */
63
63
  singleMetricVal: {
64
- type: [String, Number],
64
+ type: [String, Number, Object],
65
65
  required: true
66
66
  },
67
67
  /**
package/src/index.js CHANGED
@@ -88,6 +88,7 @@ import ToggleCarouselSlide from "./components/carousel/ToggleCarouselSlide.vue";
88
88
 
89
89
  import ToggleEmailCard from "./components/cards/ToggleEmailCard.vue";
90
90
  import ToggleRewardsCard from "./components/cards/ToggleRewardsCard.vue";
91
+ import ToggleCommentCard from "./components/cards/ToggleCommentCard.vue";
91
92
 
92
93
 
93
94
  import './sass/main.scss';
@@ -161,7 +162,8 @@ const Components = {
161
162
  ToggleCarousel,
162
163
  ToggleCarouselSlide,
163
164
  ToggleEmailCard,
164
- ToggleRewardsCard
165
+ ToggleRewardsCard,
166
+ ToggleCommentCard
165
167
  }
166
168
 
167
169
  Object.keys(Components).forEach(name => {
@@ -395,7 +395,7 @@
395
395
  }
396
396
 
397
397
  &:hover .contacts-icon {
398
- background-image: url("../assets/icons/contacts-white.svg");
398
+ background-color: white;
399
399
  }
400
400
  }
401
401
  //icons
@@ -418,9 +418,11 @@
418
418
  }
419
419
 
420
420
  .contacts-icon {
421
- background-image: url("../assets/icons/contacts-greyblue.svg");
422
- background-repeat:no-repeat;
423
- background-size:contain;
421
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='.9em' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23fff%7D%3C/style%3E%3Cpath d='M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z'/%3E%3C/svg%3E");
422
+ background-color: #6d90b4;
423
+ -webkit-mask: var(--svg);
424
+ mask: var(--svg);
425
+ mask-repeat: no-repeat;
424
426
  margin-right: 6px;
425
427
  width: 14px;
426
428
  height: 14px;
@@ -428,6 +430,38 @@
428
430
  }
429
431
  }
430
432
 
433
+ .toggle-metrics-button-small {
434
+ padding: 0px 13px;
435
+ font-size: 12px;
436
+ &.mini-contacts {
437
+ font-size: 0.65rem;
438
+ padding: 5px 12px;
439
+ }
440
+ .heatmap-icon {
441
+ width: 21px;
442
+ height: 21px;
443
+ }
444
+ .email-icon {
445
+ width: 25px;
446
+ height: 25px;
447
+ }
448
+ .contacts-icon {
449
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='.8em' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23fff%7D%3C/style%3E%3Cpath d='M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z'/%3E%3C/svg%3E");
450
+ -webkit-mask: var(--svg);
451
+ mask: var(--svg);
452
+ mask-repeat: no-repeat;
453
+ }
454
+ }
455
+
456
+ .toggle-metrics-button-large {
457
+ padding: 23px 27px;
458
+ font-size: 17px;
459
+ &.mini-contacts {
460
+ font-size: .92rem;
461
+ padding: 10px 25px;
462
+ }
463
+ }
464
+
431
465
  .toggle-button-booster-badge {
432
466
  display: flex;
433
467
  align-items: center;
@@ -164,3 +164,32 @@
164
164
 
165
165
  }
166
166
 
167
+ .toggle-comment-card {
168
+ display: flex;
169
+ flex-direction: row;
170
+ width: 100%;
171
+ height: 250px;
172
+ border-radius: 18px;
173
+ padding-right: 20px;
174
+ font-size: $toggle-font-size-regular;
175
+ font-family: $toggle-font-family;
176
+ }
177
+
178
+ .toggle-comment-card-info {
179
+ display: flex;
180
+ flex-direction: column;
181
+ justify-content: space-between;
182
+ padding: 30px 70px 20px 30px;
183
+ color: white;
184
+ border-radius: 30px;
185
+ width: 100%;
186
+
187
+ .toggle-comment-card-text {
188
+ text-align: justify;
189
+ line-height: 1.5rem;
190
+
191
+ p {
192
+ margin: 0
193
+ }
194
+ }
195
+ }
@@ -134,4 +134,9 @@
134
134
 
135
135
  .increase-padding-bottom {
136
136
  padding-bottom: 3rem !important;
137
+ }
138
+
139
+ .toggle-metric-score-rating {
140
+ font-size: 27px;
141
+ margin-left: -8px;
137
142
  }
@@ -342,6 +342,11 @@
342
342
  &.airship-hat-icon span::before {
343
343
  background-image: url("../assets/icons/airship-hat-hover.svg");
344
344
  }
345
+
346
+ &.airship-feedback-icon a::before,
347
+ &.airship-feedback-icon span::before {
348
+ background-image: url("../assets/icons/airship-feedback-hover.svg");
349
+ }
345
350
  }
346
351
  }
347
352
 
@@ -506,6 +511,17 @@
506
511
  animation: tilt-shake 0.4s;
507
512
  background-image: url("../assets/icons/airship-audiences-hover.svg");
508
513
  }
514
+ // add feedbacl
515
+ &.airship-feedback-icon a::before,
516
+ &.airship-feedback-icon span::before {
517
+ background-image: url("../assets/icons/airship-feedback.svg");
518
+ }
519
+
520
+ &.airship-feedback-icon a:hover::before,
521
+ &.airship-feedback-icon span:hover::before {
522
+ animation: tilt-shake 0.4s;
523
+ background-image: url("../assets/icons/airship-feedback-hover.svg");
524
+ }
509
525
 
510
526
  }
511
527
  }