@rypen-dev/shared-components 4.1.0 → 4.1.2

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.
@@ -1,3 +1,31 @@
1
+ @media all and (max-width: map-get($breakpoints, medium) - 1px) {
2
+ body:after {
3
+ content: 'size-small';
4
+ display: none;
5
+ }
6
+ }
7
+
8
+ @media all and (min-width: map-get($breakpoints, medium)) {
9
+ body:after {
10
+ content: 'size-medium';
11
+ display: none;
12
+ }
13
+ }
14
+
15
+ @media all and (min-width: map-get($breakpoints, large)) {
16
+ body:after {
17
+ content: 'size-large';
18
+ display: none;
19
+ }
20
+ }
21
+
22
+ @media all and (min-width: map-get($breakpoints, xlarge)) {
23
+ body:after {
24
+ content: 'size-xlarge';
25
+ display: none;
26
+ }
27
+ }
28
+
1
29
  .show-override {
2
30
  // override due to combo of on-load and vue applied styles for initially hidden items
3
31
  display: block !important;
@@ -12,132 +40,132 @@
12
40
  }
13
41
 
14
42
  .single-space {
15
- margin-bottom: 20px !important;
43
+ margin-bottom: $single-space !important;
16
44
  }
17
45
 
18
46
  .double-space {
19
- margin-bottom: 40px !important;
47
+ margin-bottom: #{$single-space * 2} !important;
20
48
  }
21
49
 
22
50
  .triple-space {
23
- margin-bottom: 60px !important;
51
+ margin-bottom: #{$single-space * 3} !important;
24
52
  }
25
53
 
26
54
  .half-space {
27
- margin-bottom: 10px !important;
55
+ margin-bottom: #{$single-space * 0.5} !important;
28
56
  }
29
57
 
30
58
  .quarter-space {
31
- margin-bottom: 5px !important;
59
+ margin-bottom: #{$single-space * 0.25} !important;
32
60
  }
33
61
 
34
62
  .single-space-top {
35
- margin-top: 20px !important;
63
+ margin-top: $single-space !important;
36
64
  }
37
65
 
38
66
  .double-space-top {
39
- margin-top: 40px !important;
67
+ margin-top: #{$single-space * 2} !important;
40
68
  }
41
69
 
42
70
  .triple-space-top {
43
- margin-top: 60px !important;
71
+ margin-top: #{$single-space * 3} !important;
44
72
  }
45
73
 
46
74
  .half-space-top {
47
- margin-top: 10px !important;
75
+ margin-top: #{$single-space * 0.5} !important;
48
76
  }
49
77
 
50
78
  .quarter-space-top {
51
- margin-top: 5px !important;
79
+ margin-top: #{$single-space * 0.25} !important;
52
80
  }
53
81
 
54
82
  .small-single-space {
55
83
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
56
- margin-bottom: 20px !important;
84
+ margin-bottom: $single-space !important;
57
85
  }
58
86
  }
59
87
 
60
88
  .medium-single-space {
61
89
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
62
- margin-bottom: 20px !important;
90
+ margin-bottom: $single-space !important;
63
91
  }
64
92
  }
65
93
 
66
94
  .small-single-space-top {
67
95
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
68
- margin-top: 20px !important;
96
+ margin-top: $single-space !important;
69
97
  }
70
98
  }
71
99
 
72
100
  .medium-single-space-top {
73
101
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
74
- margin-top: 20px !important;
102
+ margin-top: $single-space !important;
75
103
  }
76
104
  }
77
105
 
78
106
  .small-double-space {
79
107
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
80
- margin-bottom: 40px !important;
108
+ margin-bottom: #{$single-space * 2} !important;
81
109
  }
82
110
  }
83
111
 
84
112
  .medium-double-space {
85
113
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
86
- margin-bottom: 40px !important;
114
+ margin-bottom: #{$single-space * 2} !important;
87
115
  }
88
116
  }
89
117
 
90
118
  .medium-only-double-space {
91
119
  @media print, screen and (min-width: map-get($breakpoints, medium)) and (max-width: (map-get($breakpoints, large) - 1px)) {
92
- margin-bottom: 40px !important;
120
+ margin-bottom: #{$single-space * 2} !important;
93
121
  }
94
122
  }
95
123
 
96
124
  .small-double-space-top {
97
125
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
98
- margin-top: 40px !important;
126
+ margin-top: #{$single-space * 2} !important;
99
127
  }
100
128
  }
101
129
 
102
130
  .medium-double-space-top {
103
131
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
104
- margin-top: 40px !important;
132
+ margin-top: #{$single-space * 2} !important;
105
133
  }
106
134
  }
107
135
 
108
136
  .small-triple-space {
109
137
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
110
- margin-bottom: 60px !important;
138
+ margin-bottom: #{$single-space * 3} !important;
111
139
  }
112
140
  }
113
141
 
114
142
  .medium-triple-space {
115
143
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
116
- margin-bottom: 60px !important;
144
+ margin-bottom: #{$single-space * 3} !important;
117
145
  }
118
146
  }
119
147
 
120
148
  .small-half-space {
121
149
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
122
- margin-bottom: 10px !important;
150
+ margin-bottom: #{$single-space * 0.5} !important;
123
151
  }
124
152
  }
125
153
 
126
154
  .medium-half-space {
127
155
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
128
- margin-bottom: 10px !important;
156
+ margin-bottom: #{$single-space * 0.5} !important;
129
157
  }
130
158
  }
131
159
 
132
160
  .small-half-space-top {
133
161
  @media screen and (max-width: (map-get($breakpoints, medium) - 1px)) {
134
- margin-top: 10px !important;
162
+ margin-top: #{$single-space * 0.5} !important;
135
163
  }
136
164
  }
137
165
 
138
166
  .medium-half-space-top {
139
167
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
140
- margin-top: 10px !important;
168
+ margin-top: #{$single-space * 0.5} !important;
141
169
  }
142
170
  }
143
171
 
@@ -178,6 +206,18 @@ hr {
178
206
  margin-top: 0;
179
207
  }
180
208
 
209
+ &.small {
210
+ margin: 0.5rem 0;
211
+ }
212
+
213
+ &.large {
214
+ margin: 40px 0;
215
+ }
216
+
217
+ &.short {
218
+ width: 80px;
219
+ }
220
+
181
221
  &.secondary {
182
222
  border-bottom-color: $secondary;
183
223
  }
@@ -186,9 +226,9 @@ hr {
186
226
  &.tertiary-alt {
187
227
  border-bottom-color: $tertiary-alt;
188
228
  }
189
-
190
- &.small {
191
- margin: 0.5rem 0;
229
+
230
+ &.warning {
231
+ border-bottom-color: $warning;
192
232
  }
193
233
 
194
234
  &.dark-gray {
@@ -117,6 +117,11 @@
117
117
  letter-spacing: 0;
118
118
  margin-bottom: 0;
119
119
  font-family: $body-font-family;
120
+ flex-shrink: 0;
121
+ }
122
+
123
+ .row .input-container.text {
124
+ padding-top: 8px;
120
125
  }
121
126
  }
122
127
  }
@@ -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;
@@ -18,6 +18,10 @@
18
18
  display: block !important;
19
19
  }
20
20
  }
21
+
22
+ body:not(.hover-capable) &.detect-hover-capable {
23
+ cursor: pointer;
24
+ }
21
25
  }
22
26
 
23
27
  .tooltip {
@@ -113,6 +113,10 @@ h6 {
113
113
  border-bottom-color: $headline-accent-color-reversed;
114
114
  }
115
115
 
116
+ &.tertiary > span {
117
+ border-bottom-color: $tertiary;
118
+ }
119
+
116
120
  &.no-margin {
117
121
  margin-bottom: 0 !important;
118
122
  }
@@ -163,11 +167,23 @@ h3 {
163
167
  line-height: 2.5rem;
164
168
  margin-bottom: 30px;
165
169
 
170
+ &.smaller {
171
+ font-size: 1.25rem;
172
+
173
+ small {
174
+ font-size: 0.7em;
175
+ }
176
+ }
177
+
166
178
  @media print, screen and (min-width: map-get($breakpoints, medium)) {
167
179
  font-size: 2.125rem;
168
180
  line-height: 3.375rem;
169
181
  margin-bottom: 40px;
170
182
 
183
+ &.smaller {
184
+ font-size: 1.75rem;
185
+ }
186
+
171
187
  > span {
172
188
  padding-bottom: 5px;
173
189
  }
@@ -390,6 +406,11 @@ small,
390
406
  &.small {
391
407
  letter-spacing: 0.5px;
392
408
  }
409
+
410
+ &.tiny {
411
+ font-size: 0.75rem;
412
+ letter-spacing: 0.5px;
413
+ }
393
414
  }
394
415
 
395
416
  .color-primary {
@@ -405,6 +426,10 @@ small,
405
426
  color: $warning;
406
427
  }
407
428
 
429
+ .color-attention {
430
+ color: $attention;
431
+ }
432
+
408
433
  .color-success {
409
434
  color: $success;
410
435
  }
package/scss/styles.scss CHANGED
@@ -59,6 +59,7 @@
59
59
  @import './partials/tables';
60
60
  @import './partials/tooltips';
61
61
  @import './partials/typography';
62
+ @import './partials/content';
62
63
  @import './partials/specsheet';
63
64
  @import './partials/notifications';
64
65
  @import './partials/progressbar';
@@ -20,7 +20,7 @@
20
20
  <br />
21
21
  <br v-if="address.CareOf" />{{ address.CareOf }}
22
22
  <br v-if="address.ContactEmail" />{{ address.ContactEmail }}
23
- <template v-if="address.PhoneNumber"><br /><i class="fas fa-phone color-text-gray"></i> {{ formatPhone(address.PhoneNumber) }}</template>
23
+ <template v-if="address.PhoneNumber"><br /><i class="fa-solid fa-phone color-text-gray"></i> {{ formatPhone(address.PhoneNumber) }}</template>
24
24
  </template>
25
25
  </div>
26
26
  </template>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div class="input-container" :class="cssClass">
3
3
  <input type="text" v-model="value" />
4
+ <a v-if="includeClear && value.length" class="clear-button" @click="clearInput"><i class="fi-x"></i></a>
4
5
  </div>
5
6
  </template>
6
7
  <script>
@@ -10,6 +11,11 @@
10
11
  name: 'DebouncedTextBox',
11
12
  props: {
12
13
  cssClass: String,
14
+ initialValue: String,
15
+ includeClear: {
16
+ type: Boolean,
17
+ default: false,
18
+ },
13
19
  },
14
20
  data: () => {
15
21
  return {
@@ -22,6 +28,15 @@
22
28
  this.debouncedValue = value;
23
29
  this.$emit('change', value);
24
30
  });
31
+
32
+ if (this.initialValue) {
33
+ this.value = this.initialValue;
34
+ }
35
+ },
36
+ methods: {
37
+ clearInput() {
38
+ this.value = '';
39
+ },
25
40
  },
26
41
  watch: {
27
42
  value(newValue) {
@@ -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;
@@ -1,15 +0,0 @@
1
- <template>
2
- <div>
3
- <h2>This is a test component</h2>
4
- <div>
5
- <slot name="icon"></slot>
6
- </div>
7
- <div>
8
- <slot name="other"></slot>
9
- </div>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {}
15
- </script>