@kiva/kv-components 3.91.1 → 3.92.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/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
+ ## [3.92.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.92.0...@kiva/kv-components@3.92.1) (2024-08-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * vite has some complications around importing json ([7a5ced1](https://github.com/kiva/kv-ui-elements/commit/7a5ced1172e319a83b12d674529c81977c95a993))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.92.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.91.1...@kiva/kv-components@3.92.0) (2024-08-16)
18
+
19
+
20
+ ### Features
21
+
22
+ * dotted version for carousel controls ([#444](https://github.com/kiva/kv-ui-elements/issues/444)) ([a719d75](https://github.com/kiva/kv-ui-elements/commit/a719d75ce7622695668fe1467bf1129d916800c2))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [3.91.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.91.0...@kiva/kv-components@3.91.1) (2024-08-14)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.91.1",
3
+ "version": "3.92.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -82,5 +82,5 @@
82
82
  "optional": true
83
83
  }
84
84
  },
85
- "gitHead": "1a5c4e9cb95e6a1bd8fb33a423c267b6c46e570e"
85
+ "gitHead": "52085aeb1c92162fd732cd3fe4cb9839cdd49b16"
86
86
  }
package/utils/mapUtils.js CHANGED
@@ -1,5 +1,3 @@
1
- import kvTokensPrimitives from '@kiva/kv-tokens/primitives.json';
2
-
3
1
  /**
4
2
  * Code to generate random coordinates
5
3
  * */
@@ -242,8 +240,8 @@ export function animationCoordinator(mapInstance, borrowerPoints) {
242
240
 
243
241
  const flyToPoint = (index) => {
244
242
  mapInstance.flyTo({
245
- // These options control the ending camera position: centered at
246
- // the target, at zoom level 9, and north up.
243
+ // These options control the ending camera position: centered at
244
+ // the target, at zoom level 9, and north up.
247
245
  center: destinationPoints[index],
248
246
  zoom: 4,
249
247
  bearing: 0,
@@ -330,7 +328,7 @@ export const getLoansIntervals = (min, max, nbIntervals) => {
330
328
  * @param {Object} kvTokensPrimitives - kv tokens for colors
331
329
  * @returns {String} - color of the country
332
330
  * */
333
- export const getCountryColor = (lenderLoans, countriesData) => {
331
+ export const getCountryColor = (lenderLoans, countriesData, kvTokensPrimitives) => {
334
332
  const loanCountsArray = [];
335
333
  countriesData.forEach((country) => {
336
334
  loanCountsArray.push(country.value);
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
  <!-- Carousel Controls -->
32
32
  <div
33
- v-if="slideIndicatorCount > 1"
33
+ v-if="slideIndicatorCount > 1 && !isDotted"
34
34
  class="kv-carousel__controls tw-flex
35
35
  tw-justify-between md:tw-justify-center tw-items-center
36
36
  tw-mt-4 tw-w-full"
@@ -75,6 +75,26 @@
75
75
  <span class="tw-sr-only">Show next slide</span>
76
76
  </button>
77
77
  </div>
78
+ <!-- Dotted Controls -->
79
+ <div
80
+ v-else-if="slideIndicatorCount > 1"
81
+ class="kv-carousel__controls tw-flex tw-justify-center tw-items-center tw-gap-1.5 tw-mt-4 tw-w-full"
82
+ >
83
+ <button
84
+ v-for="slide in slideIndicatorCount"
85
+ :key="slide"
86
+ @click="goToSlide(slide - 1)"
87
+ >
88
+ <div
89
+ class="tw-rounded-full tw-border tw-transition tw-duration-500 tw-ease-in-out"
90
+ :class="[
91
+ { 'tw-bg-black tw-border-black tw-h-1.5 tw-w-1.5': currentIndex === slide - 1 },
92
+ { 'tw-bg-tertiary tw-border-tertiary tw-h-1 tw-w-1': currentIndex !== slide - 1 }
93
+ ]"
94
+ >
95
+ </div>
96
+ </button>
97
+ </div>
78
98
  <!-- Aside Buttons -->
79
99
  <template v-if="asideControls">
80
100
  <div
@@ -192,6 +212,13 @@ export default {
192
212
  type: Boolean,
193
213
  default: false,
194
214
  },
215
+ /**
216
+ * Dotted controls version of the carousel
217
+ * */
218
+ isDotted: {
219
+ type: Boolean,
220
+ default: false,
221
+ },
195
222
  },
196
223
  emits: [
197
224
  'change',
package/vue/KvMap.vue CHANGED
@@ -513,7 +513,7 @@ export default {
513
513
  countryStyle(feature) {
514
514
  return {
515
515
  color: kvTokensPrimitives.colors.white,
516
- fillColor: getCountryColor(feature.lenderLoans, this.countriesData),
516
+ fillColor: getCountryColor(feature.lenderLoans, this.countriesData, kvTokensPrimitives),
517
517
  weight: 1,
518
518
  fillOpacity: 1,
519
519
  };
@@ -545,7 +545,7 @@ export default {
545
545
  const { feature } = layer;
546
546
 
547
547
  layer.setStyle({
548
- fillColor: getCountryColor(feature.lenderLoans, this.countriesData),
548
+ fillColor: getCountryColor(feature.lenderLoans, this.countriesData, kvTokensPrimitives),
549
549
  });
550
550
  },
551
551
  circleMapClicked(countryIso) {
@@ -394,3 +394,17 @@ export const AsideControls = () => ({
394
394
  </kv-carousel>
395
395
  `,
396
396
  });
397
+
398
+ export const Dotted = () => ({
399
+ components: {
400
+ KvCarousel,
401
+ },
402
+ template: `
403
+ <kv-carousel
404
+ style="max-width: 400px;"
405
+ is-dotted="true"
406
+ >
407
+ ${defaultCarouselSlides}
408
+ </kv-carousel>
409
+ `,
410
+ });