@kiva/kv-components 4.7.0 → 4.8.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.8.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@4.7.1...@kiva/kv-components@4.8.0) (2025-01-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * make sure autoplay stops on carousel interactions ([a973201](https://github.com/kiva/kv-ui-elements/commit/a97320125351e82ccdd946abd91507a2f619b1d3))
12
+
13
+
14
+
15
+
16
+
17
+ ## [4.7.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@4.7.0...@kiva/kv-components@4.7.1) (2025-01-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * preset button was adding to basket because of type ([994a42f](https://github.com/kiva/kv-ui-elements/commit/994a42f36b2065c57994d1903c48ad9a14ad5c69))
23
+
24
+
25
+
26
+
27
+
6
28
  # [4.7.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@4.6.0...@kiva/kv-components@4.7.0) (2025-01-09)
7
29
 
8
30
 
@@ -71,7 +71,6 @@
71
71
  class="tw-inline-flex tw-flex-1 preset-option tw-w-8"
72
72
  :class="{'selected-option': selectedOption == option }"
73
73
  data-testid="bp-lend-cta-lend-button"
74
- type="submit"
75
74
  @click="clickPresetButton(option)"
76
75
  >
77
76
  ${{ option }}
@@ -208,6 +208,7 @@ export const AutoPlayButton = () => ({
208
208
  <a href="#" @click.native.prevent="$refs.sampleCarousel.toggleAutoPlay()" role="toggleAutoPlayButton">Toggle AutoPlay</a>
209
209
  <br/>
210
210
  <p>AutoPlay is: {{ isAutoplaying ? 'ON' : 'OFF' }}</p>
211
+ <a href="#" @click.native.prevent="$refs.sampleCarousel.goToSlide(0)">Go To Slide 0</a>
211
212
  </div>
212
213
  `,
213
214
  });
@@ -84,6 +84,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
84
84
  return slides.value.length - 1;
85
85
  });
86
86
  const goToSlide = (index) => {
87
+ var _a2, _b;
88
+ const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
89
+ if (autoplay) {
90
+ autoplay.stop();
91
+ }
87
92
  embla.value.scrollTo(index);
88
93
  };
89
94
  const handleUserInteraction = async (index, interactionType) => {
@@ -180,11 +185,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
180
185
  });
181
186
  });
182
187
  (_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
183
- console.log("autoplay:play");
184
188
  isAutoplaying.value = true;
185
189
  });
186
190
  (_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
187
- console.log("autoplay:stop");
188
191
  isAutoplaying.value = false;
189
192
  });
190
193
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  carouselUtil
3
- } from "./chunk-WLQNGWMC.js";
3
+ } from "./chunk-WJV72VFJ.js";
4
4
  import "./chunk-HV3AUBFT.js";
5
5
  import "./chunk-YCNMJ4YV.js";
6
6
  export {
@@ -48,6 +48,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
48
48
  return slides.value.length - 1;
49
49
  });
50
50
  const goToSlide = (index) => {
51
+ var _a2, _b;
52
+ const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
53
+ if (autoplay) {
54
+ autoplay.stop();
55
+ }
51
56
  embla.value.scrollTo(index);
52
57
  };
53
58
  const handleUserInteraction = async (index, interactionType) => {
@@ -144,11 +149,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
144
149
  });
145
150
  });
146
151
  (_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
147
- console.log("autoplay:play");
148
152
  isAutoplaying.value = true;
149
153
  });
150
154
  (_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
151
- console.log("autoplay:stop");
152
155
  isAutoplaying.value = false;
153
156
  });
154
157
  });
@@ -192,6 +192,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
192
192
  return slides.value.length - 1;
193
193
  });
194
194
  const goToSlide = (index) => {
195
+ var _a2, _b;
196
+ const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
197
+ if (autoplay) {
198
+ autoplay.stop();
199
+ }
195
200
  embla.value.scrollTo(index);
196
201
  };
197
202
  const handleUserInteraction = async (index, interactionType) => {
@@ -288,11 +293,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
288
293
  });
289
294
  });
290
295
  (_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
291
- console.log("autoplay:play");
292
296
  isAutoplaying.value = true;
293
297
  });
294
298
  (_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
295
- console.log("autoplay:stop");
296
299
  isAutoplaying.value = false;
297
300
  });
298
301
  });
@@ -31,7 +31,7 @@ import {
31
31
  } from "./chunk-3HK4G4NT.js";
32
32
  import {
33
33
  carouselUtil
34
- } from "./chunk-WLQNGWMC.js";
34
+ } from "./chunk-WJV72VFJ.js";
35
35
  import {
36
36
  throttle
37
37
  } from "./chunk-HV3AUBFT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -98,5 +98,5 @@
98
98
  "peerDependencies": {
99
99
  "vue": ">=3.0.0"
100
100
  },
101
- "gitHead": "714dd64c1fdea169392d23f77b934c131230df99"
101
+ "gitHead": "b556f273d9899af55972cc28add6c4bb536bb15e"
102
102
  }
@@ -57,6 +57,11 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
57
57
  * @public This is a public method
58
58
  */
59
59
  const goToSlide = (index) => {
60
+ /** Stop autoplay on go to slide interaction */
61
+ const autoplay = embla.value?.plugins()?.autoplay;
62
+ if (autoplay) {
63
+ autoplay.stop();
64
+ }
60
65
  embla.value.scrollTo(index);
61
66
  };
62
67
 
@@ -198,7 +203,6 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
198
203
  });
199
204
 
200
205
  embla?.value?.on('autoplay:play', () => {
201
- console.log('autoplay:play');
202
206
  /**
203
207
  * Fires when autoplay starts
204
208
  * @event autoplay-play
@@ -208,7 +212,6 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
208
212
  });
209
213
 
210
214
  embla?.value?.on('autoplay:stop', () => {
211
- console.log('autoplay:stop');
212
215
  /**
213
216
  * Fires when autoplay starts
214
217
  * @event autoplay-play
package/vue/KvLendCta.vue CHANGED
@@ -71,7 +71,6 @@
71
71
  class="tw-inline-flex tw-flex-1 preset-option tw-w-8"
72
72
  :class="{'selected-option': selectedOption == option }"
73
73
  data-testid="bp-lend-cta-lend-button"
74
- type="submit"
75
74
  @click="clickPresetButton(option)"
76
75
  >
77
76
  ${{ option }}
@@ -208,6 +208,7 @@ export const AutoPlayButton = () => ({
208
208
  <a href="#" @click.native.prevent="$refs.sampleCarousel.toggleAutoPlay()" role="toggleAutoPlayButton">Toggle AutoPlay</a>
209
209
  <br/>
210
210
  <p>AutoPlay is: {{ isAutoplaying ? 'ON' : 'OFF' }}</p>
211
+ <a href="#" @click.native.prevent="$refs.sampleCarousel.goToSlide(0)">Go To Slide 0</a>
211
212
  </div>
212
213
  `,
213
214
  });