@rypen-dev/shared-components 4.0.17 → 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.
@@ -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;
@@ -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
  }
@@ -2,6 +2,7 @@
2
2
  <transition name="modal">
3
3
  <div class="modal-mask hide-for-print" :class="maskCssClass" @click="closeIfCloseable">
4
4
  <div class="modal-container" :class="cssClass">
5
+ <a v-if="closeable" class="close" @click="$emit('close')"><icon-base icon-name="close" width="24" height="24" viewBox="0 0 24 24"><icon-close /></icon-base></a>
5
6
  <div class="modal-wrapper">
6
7
  <div class="modal-grid" :class="{ 'with-footer': hasFooter }">
7
8
  <div class="scrollable-content">
@@ -23,6 +24,9 @@
23
24
  </template>
24
25
 
25
26
  <script>
27
+ import IconBase from "./icons/IconBase.vue";
28
+ import IconClose from "./icons/IconClose.vue";
29
+
26
30
  export default {
27
31
  name: 'ModalWrapper',
28
32
  props: {
@@ -47,7 +51,8 @@
47
51
  }
48
52
  },
49
53
  components: {
50
-
54
+ IconBase,
55
+ IconClose,
51
56
  },
52
57
  methods: {
53
58
  closeIfCloseable(e) {
@@ -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,13 +10,12 @@ 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
- import testComponent from "./components/icons/TestComponent.vue";
19
-
20
19
  import IconBaseFile from "./components/icons/IconBase.vue";
21
20
  import IconApproveFile from "./components/icons/IconApprove.vue";
22
21
  import IconCaretFile from "./components/icons/IconCaret.vue";
@@ -40,6 +39,7 @@ const Components = {
40
39
  ModalWrapper: modalWrapper,
41
40
  NumberInput: numberInput,
42
41
  ProductImageSelector: productImageSelector,
42
+ Slideshow: slideshow,
43
43
  SuccessCheckmark: successCheckmark,
44
44
  SwitchInput: switchInput,
45
45
  TimespanInput: timespanInput,
@@ -52,8 +52,6 @@ const Components = {
52
52
  IconSave: IconSaveFile,
53
53
  IconShare: IconShareFile,
54
54
  Money: money,
55
-
56
- TestComponent: testComponent,
57
55
  };
58
56
 
59
57
  export var AddressDisplay = addressDisplay;
@@ -68,6 +66,7 @@ export var LookupTextBox = lookupTextBox;
68
66
  export var ModalWrapper = modalWrapper;
69
67
  export var NumberInput = numberInput;
70
68
  export var ProductImageSelector = productImageSelector;
69
+ export var Slideshow = slideshow;
71
70
  export var SuccessCheckmark = successCheckmark;
72
71
  export var SwitchInput = switchInput;
73
72
  export var TimespanInput = timespanInput;
@@ -81,6 +80,4 @@ export var IconSave = IconSaveFile;
81
80
  export var IconShare = IconShareFile;
82
81
  export var Money = money;
83
82
 
84
- export var TestComponent = testComponent;
85
-
86
83
  export default Components;
@@ -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>