@kiva/kv-components 3.83.0 → 3.83.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.
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.83.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.83.1...@kiva/kv-components@3.83.2) (2024-06-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * max dimensions on kvContentfulImg ([#419](https://github.com/kiva/kv-ui-elements/issues/419)) ([4496979](https://github.com/kiva/kv-ui-elements/commit/4496979544fa7d9d941111bff234aae58aa5ca16))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.83.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.83.0...@kiva/kv-components@3.83.1) (2024-06-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * event is firing twice ([#417](https://github.com/kiva/kv-ui-elements/issues/417)) ([3e30e40](https://github.com/kiva/kv-ui-elements/commit/3e30e4023c6d6af324fc99e805b0f10d36934c2e))
23
+
24
+
25
+
26
+
27
+
6
28
  # [3.83.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.82.1...@kiva/kv-components@3.83.0) (2024-06-07)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.83.0",
3
+ "version": "3.83.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,5 +75,5 @@
75
75
  "optional": true
76
76
  }
77
77
  },
78
- "gitHead": "a248af9b1215451e5b121939976b5340cf3b00bd"
78
+ "gitHead": "b24be12d68662bf99ee0d17a1ed6f4b788ae0ce5"
79
79
  }
package/utils/loanCard.js CHANGED
@@ -186,13 +186,6 @@ export function loanCardMethods(props, emit) {
186
186
  kvTrackFunction,
187
187
  } = toRefs(props);
188
188
 
189
- function showLoanDetails(event) {
190
- if (customLoanDetails.value) {
191
- event.preventDefault();
192
- emit('show-loan-details');
193
- }
194
- }
195
-
196
189
  function clickReadMore(target, event) {
197
190
  kvTrackFunction.value('Lending', 'click-Read more', target, loanId.value);
198
191
  if (customLoanDetails.value) {
@@ -202,7 +195,6 @@ export function loanCardMethods(props, emit) {
202
195
  }
203
196
 
204
197
  return {
205
- showLoanDetails,
206
198
  clickReadMore,
207
199
  };
208
200
  }
@@ -17,7 +17,6 @@
17
17
  <div
18
18
  v-else
19
19
  class="tw-relative"
20
- @click="showLoanDetails"
21
20
  >
22
21
  <component
23
22
  :is="tag"
@@ -455,7 +454,6 @@ export default {
455
454
 
456
455
  const {
457
456
  clickReadMore,
458
- showLoanDetails,
459
457
  } = loanCardMethods(props, emit);
460
458
 
461
459
  return {
@@ -480,7 +478,6 @@ export default {
480
478
  tag,
481
479
  unreservedAmount,
482
480
  clickReadMore,
483
- showLoanDetails,
484
481
  };
485
482
  },
486
483
  computed: {
@@ -213,9 +213,22 @@ export default {
213
213
 
214
214
  const buildUrl = (image = null, multiplier = 1) => {
215
215
  let src = image && image.url ? `${image.url}?` : `${contentfulSrc.value}?`;
216
- const imgWidth = image ? image.width : width.value;
217
- const imgHeight = image ? image.height : height.value;
218
-
216
+ let imgWidth = image ? image.width : width.value;
217
+ let imgHeight = image ? image.height : height.value;
218
+ // The max contentful image size is 4000px so we have to
219
+ // impose a limit of 2000px here for both height and width
220
+ // so when we request the retina x2 image we don't go over the 4000px limit
221
+ let newMultiplier;
222
+ if (imgWidth >= 2000) {
223
+ newMultiplier = imgWidth / 1999;
224
+ imgWidth = 1999;
225
+ imgHeight = Math.round(imgHeight / newMultiplier);
226
+ }
227
+ if (imgHeight >= 2000) {
228
+ newMultiplier = imgHeight / 1999;
229
+ imgHeight = 1999;
230
+ imgWidth = Math.round(imgWidth / newMultiplier);
231
+ }
219
232
  if (imgWidth) {
220
233
  src += `w=${imgWidth * multiplier}`;
221
234
  }
@@ -27,7 +27,6 @@
27
27
  <div
28
28
  v-else
29
29
  class="tw-relative tw-w-full"
30
- @click="showLoanDetails"
31
30
  >
32
31
  <component
33
32
  :is="tag"
@@ -364,7 +363,6 @@ export default {
364
363
 
365
364
  const {
366
365
  clickReadMore,
367
- showLoanDetails,
368
366
  } = loanCardMethods(props, emit);
369
367
 
370
368
  return {
@@ -389,7 +387,6 @@ export default {
389
387
  tag,
390
388
  unreservedAmount,
391
389
  clickReadMore,
392
- showLoanDetails,
393
390
  };
394
391
  },
395
392
  computed: {
@@ -4,7 +4,7 @@ export default {
4
4
  title: 'KvContentfulImg',
5
5
  component: KvContentfulImg,
6
6
  args: {
7
- contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/2TWV32iioxapwjn26ZpigZ/84ac39a1396d6be9eea472cf8791faa7/Cynthia.png',
7
+ contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/35lkLRfbLxzFPlDVgA4aKI/c435630d811f9ad35ddfc88eaea22b08/Blog-import-1082518_us_shawn_16.jpg',
8
8
  fallbackFormat: 'jpg',
9
9
  width: 200,
10
10
  height: null,
@@ -77,6 +77,7 @@ export const ResponsiveImageSet = (args, { argTypes }) => ({
77
77
  />
78
78
  `,
79
79
  });
80
+
80
81
  ResponsiveImageSet.args = {
81
82
  fit: 'fill',
82
83
  focus: 'face',
@@ -168,3 +169,28 @@ export const WithCaption = (args, { argTypes }) => ({
168
169
  />
169
170
  `,
170
171
  });
172
+
173
+ export const GiantImage = (args, { argTypes }) => ({
174
+ props: Object.keys(argTypes),
175
+ components: {
176
+ KvContentfulImg,
177
+ },
178
+ template: `
179
+ <kv-contentful-img
180
+ :contentful-src="contentfulSrc"
181
+ :fallback-format="fallbackFormat"
182
+ :width="width"
183
+ :height="height"
184
+ alt="Descriptive alt text"
185
+ :loading="loading"
186
+ :fit="fit"
187
+ :focus="focus"
188
+ />
189
+ `,
190
+ });
191
+
192
+ GiantImage.args = {
193
+ contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7dVINOyAxRaXM8p6aq7p5s/9213f63ff10dec57c5f740c056afe8a8/gradient-hero-bg__1_.jpg',
194
+ width: 4000,
195
+ height: 2000,
196
+ };