@rypen-dev/shared-components 4.1.0 → 4.1.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/dist/index.js +1 -1
- package/package.json +1 -1
- package/scss/_variables.scss +2 -0
- package/scss/checkout.scss +15 -0
- package/scss/partials/_buttons.scss +17 -17
- package/scss/partials/_forms.scss +218 -6
- package/scss/partials/_layout.scss +68 -28
- package/scss/partials/_modals.scss +5 -0
- package/scss/partials/_notifications.scss +13 -0
- package/scss/partials/_pills.scss +18 -0
- package/scss/partials/_typography.scss +21 -0
- package/src/components/Slideshow.vue +114 -0
- package/src/index.js +4 -1
- package/src/components/icons/TestComponent.vue +0 -15
|
@@ -143,6 +143,19 @@
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
.success-icon-container {
|
|
147
|
+
text-align: center;
|
|
148
|
+
text-transform: uppercase;
|
|
149
|
+
letter-spacing: 1px;
|
|
150
|
+
color: $secondary;
|
|
151
|
+
font-size: 1.125rem;
|
|
152
|
+
font-weight: normal;
|
|
153
|
+
|
|
154
|
+
svg {
|
|
155
|
+
width: 80px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
146
159
|
.success-icon {
|
|
147
160
|
.path {
|
|
148
161
|
stroke: $success;
|
|
@@ -59,6 +59,19 @@
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
&.secondary-purple,
|
|
63
|
+
&.secondary-alt {
|
|
64
|
+
border-color: $secondary-alt;
|
|
65
|
+
color: $secondary-alt;
|
|
66
|
+
|
|
67
|
+
&:hover,
|
|
68
|
+
&:focus,
|
|
69
|
+
&.active {
|
|
70
|
+
background-color: fade-out($secondary-alt, 0.75) !important;
|
|
71
|
+
color: $secondary-alt !important;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
&.turquoise,
|
|
63
76
|
&.success-alt {
|
|
64
77
|
border-color: $success-alt;
|
|
@@ -160,6 +173,11 @@
|
|
|
160
173
|
background-color: $secondary;
|
|
161
174
|
}
|
|
162
175
|
|
|
176
|
+
&.secondary-purple,
|
|
177
|
+
&.secondary-alt {
|
|
178
|
+
background-color: $secondary-alt;
|
|
179
|
+
}
|
|
180
|
+
|
|
163
181
|
&.turquoise,
|
|
164
182
|
&.success-alt {
|
|
165
183
|
background-color: $success-alt;
|
|
@@ -163,11 +163,23 @@ h3 {
|
|
|
163
163
|
line-height: 2.5rem;
|
|
164
164
|
margin-bottom: 30px;
|
|
165
165
|
|
|
166
|
+
&.smaller {
|
|
167
|
+
font-size: 1.25rem;
|
|
168
|
+
|
|
169
|
+
small {
|
|
170
|
+
font-size: 0.7em;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
166
174
|
@media print, screen and (min-width: map-get($breakpoints, medium)) {
|
|
167
175
|
font-size: 2.125rem;
|
|
168
176
|
line-height: 3.375rem;
|
|
169
177
|
margin-bottom: 40px;
|
|
170
178
|
|
|
179
|
+
&.smaller {
|
|
180
|
+
font-size: 1.75rem;
|
|
181
|
+
}
|
|
182
|
+
|
|
171
183
|
> span {
|
|
172
184
|
padding-bottom: 5px;
|
|
173
185
|
}
|
|
@@ -390,6 +402,11 @@ small,
|
|
|
390
402
|
&.small {
|
|
391
403
|
letter-spacing: 0.5px;
|
|
392
404
|
}
|
|
405
|
+
|
|
406
|
+
&.tiny {
|
|
407
|
+
font-size: 0.75rem;
|
|
408
|
+
letter-spacing: 0.5px;
|
|
409
|
+
}
|
|
393
410
|
}
|
|
394
411
|
|
|
395
412
|
.color-primary {
|
|
@@ -405,6 +422,10 @@ small,
|
|
|
405
422
|
color: $warning;
|
|
406
423
|
}
|
|
407
424
|
|
|
425
|
+
.color-attention {
|
|
426
|
+
color: $attention;
|
|
427
|
+
}
|
|
428
|
+
|
|
408
429
|
.color-success {
|
|
409
430
|
color: $success;
|
|
410
431
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="slides.length > 1" class="slideshow" :class="{ small: small }" @mouseover="triggerClearTimer" @mouseout="triggerStartTimer">
|
|
3
|
+
<div class="slideshow-wrapper">
|
|
4
|
+
<v-touch @swipeleft="goToNext" @swiperight="goToPrevious" :swipe-options="{ direction: 'horizontal', threshold: 50 }">
|
|
5
|
+
<div v-for="(slide, index) in slides" class="slide" :class="{ current: index == currentIndex, prev: index === previousIndex, next: index === nextIndex }" :style="backgroundImage(slide)"></div>
|
|
6
|
+
</v-touch>
|
|
7
|
+
<a v-if="slides.length > 1 || forceNav" class="nav prev show-for-medium" @click="goToPrevious"></a>
|
|
8
|
+
<a v-if="slides.length > 1 || forceNav" class="nav next show-for-medium" @click="goToNext"></a>
|
|
9
|
+
</div>
|
|
10
|
+
<nav class="slideshow-nav">
|
|
11
|
+
<a v-for="(slide, index) in slides" :aria-label="index" :class="{ current: index == currentIndex }" @click="goToSlide(index)"></a>
|
|
12
|
+
</nav>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-else>
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'Slideshow',
|
|
22
|
+
props: {
|
|
23
|
+
slides: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: [],
|
|
26
|
+
},
|
|
27
|
+
usePrefix: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true,
|
|
30
|
+
},
|
|
31
|
+
prefix: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: WCONFIG_IMAGE_BASE_PATH,
|
|
34
|
+
},
|
|
35
|
+
auto: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true,
|
|
38
|
+
},
|
|
39
|
+
small: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
widthSuffix: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: null,
|
|
46
|
+
},
|
|
47
|
+
delay: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 7000,
|
|
50
|
+
},
|
|
51
|
+
forceNav: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
data: () => {
|
|
57
|
+
return {
|
|
58
|
+
currentIndex: 0,
|
|
59
|
+
timer: null,
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
created: function () {
|
|
63
|
+
this.triggerStartTimer();
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
goToPrevious() {
|
|
67
|
+
this.goToSlide(this.previousIndex);
|
|
68
|
+
},
|
|
69
|
+
goToNext() {
|
|
70
|
+
this.goToSlide(this.nextIndex);
|
|
71
|
+
},
|
|
72
|
+
goToSlide(index) {
|
|
73
|
+
this.triggerClearTimer();
|
|
74
|
+
this.currentIndex = index;
|
|
75
|
+
this.$emit('change', index);
|
|
76
|
+
this.triggerStartTimer();
|
|
77
|
+
},
|
|
78
|
+
triggerStartTimer() {
|
|
79
|
+
if (this.auto) {
|
|
80
|
+
this.startTimer();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
startTimer() {
|
|
84
|
+
if (this.slides.length > 0) {
|
|
85
|
+
if (this.timer !== null) {
|
|
86
|
+
clearTimeout(this.timer);
|
|
87
|
+
}
|
|
88
|
+
this.timer = setTimeout(this.goToNext, this.delay);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
triggerClearTimer() {
|
|
92
|
+
if (this.auto) {
|
|
93
|
+
this.clearTimer();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
clearTimer() {
|
|
97
|
+
clearTimeout(this.timer);
|
|
98
|
+
this.timer = null;
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
backgroundImage(slide) {
|
|
102
|
+
return { backgroundImage: 'url("' + (this.usePrefix ? this.prefix : '') + slide + (this.widthSuffix ? ';width=' + this.widthSuffix : '') + '")' };
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
computed: {
|
|
106
|
+
previousIndex() {
|
|
107
|
+
return this.currentIndex === 0 ? this.slides.length - 1 : this.currentIndex - 1;
|
|
108
|
+
},
|
|
109
|
+
nextIndex() {
|
|
110
|
+
return this.currentIndex === this.slides.length - 1 ? 0 : this.currentIndex + 1;
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -10,9 +10,10 @@ import lookupTextBox from "./components/LookupTextBox.vue";
|
|
|
10
10
|
import modalWrapper from "./components/ModalWrapper.vue";
|
|
11
11
|
import numberInput from "./components/NumberInput.vue";
|
|
12
12
|
import productImageSelector from "./components/ProductImageSelector.vue";
|
|
13
|
+
import slideshow from "./components/Slideshow.vue";
|
|
13
14
|
import switchInput from "./components/SwitchInput.vue";
|
|
14
|
-
import timespanInput from "./components/TimespanInput.vue";
|
|
15
15
|
import successCheckmark from "./components/SuccessCheckmark.vue";
|
|
16
|
+
import timespanInput from "./components/TimespanInput.vue";
|
|
16
17
|
import variableLoader from "./components/VariableLoader.vue";
|
|
17
18
|
|
|
18
19
|
import IconBaseFile from "./components/icons/IconBase.vue";
|
|
@@ -38,6 +39,7 @@ const Components = {
|
|
|
38
39
|
ModalWrapper: modalWrapper,
|
|
39
40
|
NumberInput: numberInput,
|
|
40
41
|
ProductImageSelector: productImageSelector,
|
|
42
|
+
Slideshow: slideshow,
|
|
41
43
|
SuccessCheckmark: successCheckmark,
|
|
42
44
|
SwitchInput: switchInput,
|
|
43
45
|
TimespanInput: timespanInput,
|
|
@@ -64,6 +66,7 @@ export var LookupTextBox = lookupTextBox;
|
|
|
64
66
|
export var ModalWrapper = modalWrapper;
|
|
65
67
|
export var NumberInput = numberInput;
|
|
66
68
|
export var ProductImageSelector = productImageSelector;
|
|
69
|
+
export var Slideshow = slideshow;
|
|
67
70
|
export var SuccessCheckmark = successCheckmark;
|
|
68
71
|
export var SwitchInput = switchInput;
|
|
69
72
|
export var TimespanInput = timespanInput;
|