@kiva/kv-components 3.92.0 → 3.93.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 +22 -0
- package/package.json +2 -2
- package/utils/mapUtils.js +3 -5
- package/vue/KvCarousel.vue +31 -2
- package/vue/KvMap.vue +2 -2
- package/vue/stories/KvCarousel.stories.js +17 -1
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.93.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.92.1...@kiva/kv-components@3.93.0) (2024-08-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* carousel circle effect ([c982be4](https://github.com/kiva/kv-ui-elements/commit/c982be4d088f18cb53b5d97b3071fa7dac72e1c6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* vite has some complications around importing json ([7a5ced1](https://github.com/kiva/kv-ui-elements/commit/7a5ced1172e319a83b12d674529c81977c95a993))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [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)
|
|
7
29
|
|
|
8
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.93.0",
|
|
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": "
|
|
85
|
+
"gitHead": "56fc9a0c3f8657e2bc69c6acecf01009ec86ee57"
|
|
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
|
-
|
|
246
|
-
|
|
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);
|
package/vue/KvCarousel.vue
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
<!-- Carousel Content -->
|
|
9
9
|
<div
|
|
10
10
|
class="tw-flex tw-gap-x-4"
|
|
11
|
-
:class="{
|
|
11
|
+
:class="{
|
|
12
|
+
'tw-mx-auto aside-controls-content': asideControls,
|
|
13
|
+
'circle-carousel': inCircle
|
|
14
|
+
}"
|
|
12
15
|
@click.capture="onCarouselContainerClick"
|
|
13
16
|
>
|
|
14
17
|
<div
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
:aria-current="currentIndex === index ? 'true' : 'false'"
|
|
21
24
|
:aria-hidden="isAriaHidden(index)? 'true' : 'false'"
|
|
22
25
|
:tab-index="isAriaHidden(index) ? '-1' : false"
|
|
23
|
-
:class="{ 'tw-w-full': !multipleSlidesVisible || slideMaxWidth }"
|
|
26
|
+
:class="{ 'tw-w-full': !multipleSlidesVisible || slideMaxWidth, 'cirle-slide': inCircle }"
|
|
24
27
|
:style="slideMaxWidth ? `max-width:${slideMaxWidth}` :''"
|
|
25
28
|
>
|
|
26
29
|
<slot
|
|
@@ -219,6 +222,13 @@ export default {
|
|
|
219
222
|
type: Boolean,
|
|
220
223
|
default: false,
|
|
221
224
|
},
|
|
225
|
+
/**
|
|
226
|
+
* Enables carousel slides to have a circle effect
|
|
227
|
+
* */
|
|
228
|
+
inCircle: {
|
|
229
|
+
type: Boolean,
|
|
230
|
+
default: false,
|
|
231
|
+
},
|
|
222
232
|
},
|
|
223
233
|
emits: [
|
|
224
234
|
'change',
|
|
@@ -414,4 +424,23 @@ export default {
|
|
|
414
424
|
width: 82%;
|
|
415
425
|
}
|
|
416
426
|
}
|
|
427
|
+
|
|
428
|
+
.cirle-slide {
|
|
429
|
+
width: auto;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.cirle-slide.is-selected >>> img {
|
|
433
|
+
opacity: 1;
|
|
434
|
+
transform: scale(1);
|
|
435
|
+
max-width: 300px;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.cirle-slide:not(.is-selected) >>> img {
|
|
439
|
+
opacity: 0.5;
|
|
440
|
+
transform: scale(0.5);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.circle-carousel {
|
|
444
|
+
margin: 0 auto;
|
|
445
|
+
}
|
|
417
446
|
</style>
|
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) {
|
|
@@ -402,7 +402,23 @@ export const Dotted = () => ({
|
|
|
402
402
|
template: `
|
|
403
403
|
<kv-carousel
|
|
404
404
|
style="max-width: 400px;"
|
|
405
|
-
is-dotted="true"
|
|
405
|
+
:is-dotted="true"
|
|
406
|
+
>
|
|
407
|
+
${defaultCarouselSlides}
|
|
408
|
+
</kv-carousel>
|
|
409
|
+
`,
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
export const ThreeDimensional = () => ({
|
|
413
|
+
components: {
|
|
414
|
+
KvCarousel,
|
|
415
|
+
},
|
|
416
|
+
template: `
|
|
417
|
+
<kv-carousel
|
|
418
|
+
:embla-options="{ loop: false, align: 'center' }"
|
|
419
|
+
style="max-width: 600px;"
|
|
420
|
+
:is-dotted="true"
|
|
421
|
+
:in-circle="true"
|
|
406
422
|
>
|
|
407
423
|
${defaultCarouselSlides}
|
|
408
424
|
</kv-carousel>
|