toggle-components-library 1.32.0-beta.1 → 1.32.0-beta.11

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/dist/toggle-components-library.common.js +121 -4940
  2. package/dist/toggle-components-library.common.js.map +1 -1
  3. package/dist/toggle-components-library.css +1 -1
  4. package/dist/toggle-components-library.umd.js +121 -4940
  5. package/dist/toggle-components-library.umd.js.map +1 -1
  6. package/dist/toggle-components-library.umd.min.js +6 -27
  7. package/dist/toggle-components-library.umd.min.js.map +1 -1
  8. package/package-lock.json +1 -11
  9. package/package.json +76 -78
  10. package/src/components/metrics/ToggleMetricFunnelChart.vue +8 -27
  11. package/src/components/metrics/ToggleMetricSingleMetric.vue +2 -15
  12. package/src/components/statusbar/ToggleStatusBar.vue +39 -0
  13. package/src/index.js +2 -4
  14. package/src/sass/includes/_as_badges.scss +0 -78
  15. package/src/sass/includes/_as_buttons.scss +1 -99
  16. package/src/sass/includes/_as_metrics.scss +3 -20
  17. package/src/sass/includes/_as_statusbar.scss +60 -0
  18. package/src/sass/main.scss +1 -2
  19. package/dist/img/clock-solid.fdaf024d.svg +0 -1
  20. package/dist/img/contacts-greyblue.ef6f8a9a.svg +0 -1
  21. package/dist/img/contacts-white.95d07c7a.svg +0 -1
  22. package/dist/img/view_email.508021c9.svg +0 -7
  23. package/dist/img/view_heatmap.f9058fdb.svg +0 -1
  24. package/src/assets/icons/clock-solid.svg +0 -1
  25. package/src/assets/icons/contacts-greyblue.svg +0 -1
  26. package/src/assets/icons/contacts-white.svg +0 -1
  27. package/src/assets/icons/contacts.svg +0 -1
  28. package/src/assets/icons/view_email.svg +0 -7
  29. package/src/assets/icons/view_heatmap.svg +0 -1
  30. package/src/components/badges/ToggleCalculateBadge.vue +0 -13
  31. package/src/components/badges/TogglePodiumBadge.vue +0 -32
  32. package/src/components/buttons/ToggleMetricsButton.vue +0 -36
  33. package/src/components/cards/ToggleRewardsCard.vue +0 -80
  34. package/src/components/carousel/ToggleCarousel.vue +0 -94
  35. package/src/components/carousel/ToggleCarouselSlide.vue +0 -26
  36. package/src/sass/includes/_as_cards.scss +0 -103
  37. package/src/sass/includes/_as_carousels.scss +0 -83
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6D90B4}</style><path d="M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6d90b4}</style><path 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"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#fff}</style><path 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"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6d90b4}</style><path 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"/></svg>
@@ -1,7 +0,0 @@
1
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
2
-
3
- <svg width="800px" height="800px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#000000">
4
-
5
-
6
-
7
-
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#ffeab2}</style><path d="M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"/></svg>
@@ -1,13 +0,0 @@
1
- <template>
2
- <div class="toggle-calculate-badge">
3
- <div class="clock-icon"></div>
4
- <slot></slot>
5
- </div>
6
- </template>
7
-
8
- <script>
9
-
10
- export default {
11
- name: 'ToggleCalculateBadge',
12
- }
13
- </script>
@@ -1,32 +0,0 @@
1
- <template>
2
- <div :class="['toggle-podium-badge', position]">
3
- <div class="podium-number">{{ podiumNum }}</div>
4
- <slot></slot>
5
- </div>
6
- </template>
7
-
8
- <script>
9
-
10
- export default {
11
- name: 'TogglePodiumBadge',
12
- props: {
13
- position:{
14
- type:String
15
- }
16
- },
17
- computed: {
18
- podiumNum(){
19
- switch (this.position) {
20
- case 'first':
21
- return 1;
22
- case 'second':
23
- return 2;
24
- case 'third':
25
- return 3;
26
- default:
27
- return 1;
28
- }
29
- }
30
- }
31
- }
32
- </script>
@@ -1,36 +0,0 @@
1
- <template>
2
- <button :class="['toggle-metrics-button', buttonStyle]" @click="click">
3
- <div :class="icon"></div>
4
- <slot>{{buttonText}}</slot>
5
- </button>
6
- </template>
7
-
8
- <script>
9
- export default {
10
- name: 'ToggleMetricButton',
11
- props: {
12
- buttonStyle: {
13
- type: String,
14
- default: "Metrics"
15
- },
16
- buttonText: {
17
- type: String,
18
- default: "Metrics text"
19
- },
20
- icon: {
21
- type: String,
22
- required: true,
23
- },
24
- },
25
- methods: {
26
- click() {
27
- /**
28
- * Emitted when the button is clicked.
29
- * @event click
30
- * @type {Event}
31
- */
32
- this.$emit('click');
33
- },
34
- },
35
- };
36
- </script>
@@ -1,80 +0,0 @@
1
- <template>
2
- <div class="toggle-rewards-card-reward-card">
3
- <div class="toggle-rewards-card-reward-info" :style="{ backgroundColor: cardColor[0]}">
4
- <div class="toggle-rewards-card-card-header">
5
- <slot name="toggle-rewards-card-header">{{ reward }}</slot>
6
- </div>
7
- <div class="toggle-rewards-card-card-body">
8
- <p class="toggle-rewards-card-body-header">Overall voucher performance</p>
9
- <div class="toggle-rewards-card-body-stats">
10
- <div class="toggle-rewards-card-metrics">
11
- <p>Claimed</p>
12
- <slot name="toggle-rewards-card-claimed">{{ claimed }}</slot>
13
- </div>
14
- <div class="toggle-rewards-card-metrics">
15
- <p>Redeemed</p>
16
- <slot name="toggle-rewards-card-redeemed"> {{ redeemed }}</slot>
17
- </div>
18
- </div>
19
- </div>
20
- </div>
21
- <div class="toggle-rewards-card-reward-redemption" :style="{ backgroundColor: cardColor[1]}">
22
- <div class="toggle-rewards-card-percentage">{{ redepmtionRate }}%</div>
23
- <p>Redemption rate</p>
24
- </div>
25
- </div>
26
- </template>
27
- <script>
28
- export default {
29
- props: {
30
- cardIndex: {
31
- type: Number,
32
- required: true,
33
- },
34
- totalCards: {
35
- type: Number,
36
- required: true,
37
- },
38
- reward: {
39
- type: String,
40
- required: true
41
- },
42
- redeemed: {
43
- type: Number,
44
- required: true
45
- },
46
- claimed: {
47
- type: Number,
48
- required: true
49
- }
50
- },
51
- computed: {
52
- redepmtionRate(){
53
- let rate = (Number(this.redeemed)*100)/Number(this.claimed);
54
- return rate;
55
- },
56
-
57
- cardColor() {
58
- // adjust colour palette below to change the Reward Cards colors
59
- const colorPalette = [
60
- [ '#eac6c7', '#b16f6f' ], // Pinks
61
- [ '#9AB7D3', '#6b8093' ], // Blues
62
- [ '#BDD0C4', '#849189' ], // Greens
63
- [ '#eccb92', '#ce9847' ], // Yellows
64
- [ '#DFCCF1', '#9c8ea8' ], // Purple
65
- ];
66
- // pick random number to return random index of colourPalette
67
- const paletteIndex = Math.floor(
68
- (this.cardIndex / this.totalCards) * colorPalette.length
69
- );
70
-
71
- return colorPalette[paletteIndex];
72
- }
73
- },
74
- };
75
- </script>
76
-
77
- <style scoped>
78
-
79
- </style>
80
-
@@ -1,94 +0,0 @@
1
- <template>
2
- <swiper
3
- ref="swiper"
4
- class="swiper toggle-carousel"
5
- :class="carouselStyle == 'voucher' ? 'toggle-carousel--voucher' : ''"
6
- :options="carouselOptions"
7
- @slideChangeTransitionStart="onSlideTransition"
8
- >
9
- <slot></slot>
10
- <div v-if="carouselNavigation" class="toggle-carousel-button toggle-carousel-button--prev"
11
- :class="{'toggle-carousel-button--disabled': prevDisabled}"
12
- @click="$refs.swiper.swiperInstance.slidePrev()"
13
- slot="button-prev"
14
- ></div>
15
- <div v-if="carouselNavigation" class="toggle-carousel-button toggle-carousel-button--next"
16
- :class="{'toggle-carousel-button--disabled': nextDisabled}"
17
- @click="$refs.swiper.swiperInstance.slideNext()"
18
- slot="button-next"
19
- ></div>
20
- </swiper>
21
- </template>
22
-
23
- <script>
24
-
25
- import { Swiper, directive } from 'vue-awesome-swiper'
26
- import 'swiper/swiper.css'
27
- import 'swiper/modules/navigation.css'
28
-
29
- export default {
30
- name: 'ToggleCarousel',
31
- data: function() {
32
- return {
33
- prevDisabled: false,
34
- nextDisabled: false,
35
- };
36
- },
37
- props: {
38
- carouselStyle:{
39
- type: String,
40
- default: 'default'
41
- },
42
- carouselNavigation: {
43
- type: Boolean,
44
- default: true
45
- },
46
- carouselOptions: {
47
- type: Object,
48
- required: false,
49
- default: () => {
50
- return {
51
- slidesPerView: 'auto',
52
- spaceBetween: 50,
53
- navigation: {
54
- nextButton: ".toggle-carousel-button--next",
55
- prevButton: ".toggle-carousel-button--prev"
56
- }
57
- }
58
- }
59
- }
60
- },
61
- components: {
62
- Swiper
63
- },
64
- directives: {
65
- swiper: directive
66
- },
67
- mounted() {
68
- this.onSlideTransition();
69
- },
70
- methods: {
71
- onSlideTransition(){
72
- // if loop is enabled, don't disable buttons
73
- const isLoop = this.$refs.swiper.swiperInstance.params.loop;
74
- if(isLoop) return;
75
-
76
- const isBeginning = this.$refs.swiper.swiperInstance.isBeginning;
77
- const isEnd = this.$refs.swiper.swiperInstance.isEnd;
78
-
79
- if(isBeginning){
80
- this.prevDisabled = true;
81
- this.nextDisabled = false;
82
- }
83
- else if(isEnd){
84
- this.prevDisabled = false;
85
- this.nextDisabled = true;
86
- }
87
- else{
88
- this.prevDisabled = false;
89
- this.nextDisabled = false;
90
- }
91
- }
92
- }
93
- }
94
- </script>
@@ -1,26 +0,0 @@
1
- <template>
2
- <swiper-slide class="toggle-carousel-slide" :style="'width:' + slideWidth + '; height:' + slideHeight">
3
- <slot></slot>
4
- </swiper-slide>
5
- </template>
6
-
7
- <script>
8
- import { SwiperSlide } from 'vue-awesome-swiper'
9
-
10
- export default {
11
- name: 'ToggleCarouselSlide',
12
- components: {
13
- SwiperSlide
14
- },
15
- props: {
16
- slideWidth:{
17
- type: String,
18
- default: '100%'
19
- },
20
- slideHeight:{
21
- type: String,
22
- default: 'auto'
23
- }
24
- }
25
- }
26
- </script>
@@ -1,103 +0,0 @@
1
- .toggle-rewards-card-reward-card {
2
- display: flex;
3
- flex-direction: row;
4
- max-width: 800px;
5
- height: 300px;
6
- border-radius: 18px;
7
- margin: 16px;
8
- font-family: $toggle-font-family;
9
- }
10
-
11
- .toggle-rewards-card-reward-info {
12
- display: flex;
13
- flex-direction: column;
14
- justify-content: space-between;
15
- width:65%;
16
- padding: 10px 40px;
17
- // background-color: #ABC9C0;
18
- color: white;
19
- border-top-left-radius: 18px;
20
- border-bottom-left-radius: 18px;
21
-
22
- .toggle-rewards-card-card-header {
23
- font-size: 2.2rem;
24
- font-weight: 600;
25
- margin-top: 20px;
26
- }
27
- }
28
-
29
- .toggle-rewards-card-card-body {
30
- display: flex;
31
- flex-direction: column;
32
-
33
- .toggle-rewards-card-body-header {
34
- font-size: 1.5rem;
35
- font-weight: 800;
36
- color:#000000;
37
- opacity: 0.4;
38
- }
39
- }
40
-
41
- .toggle-rewards-card-body-stats {
42
- display: inline-block;
43
- align-items: flex-start;
44
- flex-direction: column;
45
- margin-bottom: 20px;
46
-
47
- p {
48
- margin: 3px 20px 3px 0px;
49
- color:#000000;
50
- opacity: 0.4;
51
- }
52
-
53
- .toggle-rewards-card-metrics {
54
- display: flex;
55
- flex-direction: row;
56
- align-items: center;
57
- font-weight: 800;
58
- font-size: 1.1rem;
59
-
60
- }
61
-
62
- .toggle-rewards-card-metrics:last-child {
63
- margin-top: 8px;
64
- }
65
-
66
-
67
- }
68
-
69
-
70
- .toggle-rewards-card-reward-redemption {
71
- display: flex;
72
- flex-direction: column;
73
- align-items: center;
74
- justify-content: flex-end;
75
- padding-bottom: 40px;
76
- width: 35%;
77
- // background-color: #89A79E;
78
- border-top-right-radius: 18px;
79
- border-bottom-right-radius: 18px;
80
-
81
- p {
82
- color:#000000;
83
- opacity: 0.4;
84
- font-size: $toggle-font-size-large;
85
- font-weight: 800;
86
- margin-top: 20px;
87
- }
88
-
89
- .toggle-rewards-card-percentage {
90
- background-color:hsla(0, 0%, 0%, 0.4) ;
91
- border-radius: 50%;
92
- width: 100px;
93
- height: 100px;
94
- color: white;
95
- font-size: 1.7em;
96
- font-weight: 700;
97
- display: flex;
98
- justify-content: center;
99
- align-items: center;
100
- }
101
- }
102
-
103
-
@@ -1,83 +0,0 @@
1
- .toggle-carousel{
2
- cursor: grab;
3
- &:active {
4
- cursor: grabbing;
5
- }
6
- &--voucher{
7
- &:after{
8
- content: '';
9
- position: absolute;
10
- width: 15%;
11
- background: linear-gradient(90deg, rgba(241, 245, 246, 0) 0%, rgba(241, 245, 246, 0.7) 50%, rgba(241, 245, 246, 1) 100%);
12
- right: 0;
13
- top: 0;
14
- height: 100%;
15
- z-index: 25;
16
- }
17
- }
18
- .toggle-carousel-slide{
19
- img{
20
- max-width: 100%;
21
- }
22
- }
23
- .toggle-carousel-button{
24
- width: 50px;
25
- height: 50px;
26
- display: flex;
27
- align-items: center;
28
- justify-content: center;
29
- color: #FFF;
30
- background-color: #2680EB;
31
- border-radius: 100%;
32
- position: absolute;
33
- top: 50%;
34
- transform: translate(0,-50%);
35
- cursor: pointer;
36
- z-index: 50;
37
- &:hover{
38
- background-color: #3487ec;
39
- }
40
- &:before, &:after{
41
- content: '';
42
- width: 4px;
43
- height: 15px;
44
- background-color: #FFF;
45
- position: relative;
46
- }
47
- &:before{
48
- border-radius: 0 0 5px 5px;
49
- }
50
- &:after{
51
- border-radius: 5px 5px 0 ;
52
- }
53
- &--prev{
54
- left: 20px;
55
- &:before{
56
- top: 6px;
57
- transform: rotate(-45deg);
58
- top: 4px;
59
- }
60
- &:after{
61
- transform: rotate(45deg);
62
- top: -4px;
63
- left: -4px;
64
- }
65
- }
66
- &--next{
67
- right: 20px;
68
- &:before{
69
- top: 6px;
70
- transform: rotate(45deg);
71
- top: 4px;
72
- left: 4px;
73
- }
74
- &:after{
75
- transform: rotate(-45deg);
76
- top: -4px;
77
- }
78
- }
79
- &--disabled{
80
- display: none;
81
- }
82
- }
83
- }