@kiva/kv-components 5.3.1 → 5.3.3

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 +1 @@
1
- .amountDropdownWrapper[data-v-e8a71378] select{border-radius:14px 0 0 14px}.lend-again[data-v-e8a71378] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-e8a71378] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-e8a71378] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-e8a71378] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-e8a71378] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-e8a71378] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-option[data-v-e8a71378] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}
1
+ .amountDropdownWrapper[data-v-74dcdf98] select{border-radius:14px 0 0 14px}.lend-again[data-v-74dcdf98] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-74dcdf98] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-74dcdf98] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-74dcdf98] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-74dcdf98] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-74dcdf98] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-option[data-v-74dcdf98] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}
@@ -4,7 +4,7 @@ import C from "./KvLendAmountButton.js";
4
4
  import _ from "./KvSelect.js";
5
5
  import D from "./KvButton.js";
6
6
  import P from "./KvMaterialIcon.js";
7
- import { resolveComponent as w, openBlock as i, createElementBlock as a, createBlock as l, normalizeClass as d, withCtx as r, createTextVNode as c, toDisplayString as m, createElementVNode as y, createVNode as S, withModifiers as A, Fragment as v, renderList as p, createCommentVNode as u } from "vue";
7
+ import { resolveComponent as w, openBlock as i, createElementBlock as a, createBlock as l, normalizeClass as r, withCtx as d, createTextVNode as c, toDisplayString as m, createElementVNode as y, createVNode as S, withModifiers as A, Fragment as p, renderList as v, createCommentVNode as u } from "vue";
8
8
  import "./KvLendCta.css";
9
9
  import F from "../_virtual/_plugin-vue_export-helper.js";
10
10
  const I = {
@@ -219,7 +219,7 @@ const I = {
219
219
  return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
220
220
  },
221
221
  isLendAmountButton() {
222
- return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount);
222
+ return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
223
223
  },
224
224
  isFunded() {
225
225
  return this.state === "funded" || this.state === "fully-reserved";
@@ -235,6 +235,9 @@ const I = {
235
235
  },
236
236
  showFilteredDropdown() {
237
237
  return this.presetDropdownPrices.length > 1;
238
+ },
239
+ hideLendButton() {
240
+ return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
238
241
  }
239
242
  },
240
243
  watch: {
@@ -325,13 +328,13 @@ function U(e, s, n, k, f, t) {
325
328
  t.isInBasket ? (i(), l(h, {
326
329
  key: 0,
327
330
  variant: "secondary",
328
- class: d(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
331
+ class: r(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
329
332
  "data-testid": "bp-lend-cta-checkout-button",
330
333
  to: n.externalLinks ? void 0 : "/basket",
331
334
  href: n.externalLinks ? "/basket" : void 0,
332
335
  onClick: s[0] || (s[0] = (o) => t.clickSecondaryButton(o))
333
336
  }, {
334
- default: r(() => [
337
+ default: d(() => [
335
338
  c(m(t.loanInBasketButtonText), 1)
336
339
  ]),
337
340
  _: 1
@@ -339,7 +342,7 @@ function U(e, s, n, k, f, t) {
339
342
  key: 1,
340
343
  class: "tw-inline-flex tw-flex-1"
341
344
  }, {
342
- default: r(() => [
345
+ default: d(() => [
343
346
  c(m(t.ctaButtonText), 1)
344
347
  ]),
345
348
  _: 1
@@ -351,7 +354,7 @@ function U(e, s, n, k, f, t) {
351
354
  class: "tw-mb-0",
352
355
  onClick: s[1] || (s[1] = (o) => e.$emit("show-loan-details", o))
353
356
  }, {
354
- default: r(() => [
357
+ default: d(() => [
355
358
  y("span", N, [
356
359
  s[5] || (s[5] = c(" View loan ")),
357
360
  S(L, {
@@ -367,22 +370,22 @@ function U(e, s, n, k, f, t) {
367
370
  onSubmit: s[4] || (s[4] = A((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
368
371
  }, [
369
372
  y("fieldset", {
370
- class: d(["tw-w-full tw-flex", { "tw-flex-col tw-gap-1.5 md:tw-flex-row md:tw-justify-between": n.showPresetAmounts }]),
373
+ class: r(["tw-w-full tw-flex", { "tw-flex-col tw-gap-1.5 md:tw-flex-row md:tw-justify-between": n.showPresetAmounts }]),
371
374
  disabled: n.isAdding,
372
375
  "data-testid": "bp-lend-cta-select-and-button"
373
376
  }, [
374
- n.showPresetAmounts ? (i(), a("div", {
377
+ n.showPresetAmounts && !n.isAdding ? (i(), a("div", {
375
378
  key: 0,
376
- class: d(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": n.enableHugeAmount }])
379
+ class: r(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": n.enableHugeAmount }])
377
380
  }, [
378
- t.isLendAmountButton ? u("", !0) : (i(!0), a(v, { key: 0 }, p(t.presetButtonsPrices, (o) => (i(), l(h, {
381
+ t.isLendAmountButton ? u("", !0) : (i(!0), a(p, { key: 0 }, v(t.presetButtonsPrices, (o) => (i(), l(h, {
379
382
  key: o,
380
383
  variant: "secondary",
381
- class: d(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": f.selectedOption == o }]),
384
+ class: r(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": f.selectedOption == o }]),
382
385
  "data-testid": "bp-lend-cta-lend-button",
383
386
  onClick: (j) => t.clickPresetButton(o)
384
387
  }, {
385
- default: r(() => [
388
+ default: d(() => [
386
389
  c(" $" + m(o), 1)
387
390
  ]),
388
391
  _: 2
@@ -395,7 +398,7 @@ function U(e, s, n, k, f, t) {
395
398
  s[2] || (s[2] = (o) => f.selectedDropdownOption = o),
396
399
  t.trackLendAmountSelection
397
400
  ],
398
- class: d(["tw-min-w-12 tw-rounded filtered-dropdown", {
401
+ class: r(["tw-min-w-12 tw-rounded filtered-dropdown", {
399
402
  "unselected-dropdown": !t.selectedDropdown,
400
403
  "selected-dropdown": t.selectedDropdown,
401
404
  "tw-w-full": n.enableHugeAmount
@@ -403,8 +406,8 @@ function U(e, s, n, k, f, t) {
403
406
  "aria-label": "Lend amount",
404
407
  onClick: A(t.clickDropdown, ["stop"])
405
408
  }, {
406
- default: r(() => [
407
- (i(!0), a(v, null, p(t.presetDropdownPrices, (o) => (i(), a("option", {
409
+ default: d(() => [
410
+ (i(!0), a(p, null, v(t.presetDropdownPrices, (o) => (i(), a("option", {
408
411
  key: o,
409
412
  value: o
410
413
  }, m(o !== "Other" ? `$${o}` : o), 9, H))), 128))
@@ -425,8 +428,8 @@ function U(e, s, n, k, f, t) {
425
428
  "aria-label": "Lend amount",
426
429
  onClick: A(t.clickDropdown, ["stop"])
427
430
  }, {
428
- default: r(() => [
429
- (i(!0), a(v, null, p(t.prices, (o) => (i(), a("option", {
431
+ default: d(() => [
432
+ (i(!0), a(p, null, v(t.prices, (o) => (i(), a("option", {
430
433
  key: o,
431
434
  value: o
432
435
  }, " $" + m(o), 9, R))), 128))
@@ -435,28 +438,28 @@ function U(e, s, n, k, f, t) {
435
438
  }, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : u("", !0)
436
439
  ])),
437
440
  y("div", {
438
- class: d({
441
+ class: r({
439
442
  lendButtonWrapper: t.hideShowLendDropdown && !n.showPresetAmounts,
440
- "tw-hidden": n.isAdding && n.showPresetAmounts
443
+ "tw-hidden": t.hideLendButton
441
444
  })
442
445
  }, [
443
446
  t.lendButtonVisibility && !t.isLessThan25 ? (i(), l(h, {
444
447
  key: "lendButton",
445
- class: d(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
448
+ class: r(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
446
449
  "data-testid": "bp-lend-cta-lend-button",
447
450
  type: "submit"
448
451
  }, {
449
- default: r(() => [
452
+ default: d(() => [
450
453
  c(m(t.ctaButtonText), 1)
451
454
  ]),
452
455
  _: 1
453
456
  }, 8, ["class"])) : t.showLendAgain ? (i(), l(h, {
454
457
  key: "lendAgainButton",
455
- class: d(["lend-again", { "tw-w-full": n.showPresetAmounts }]),
458
+ class: r(["lend-again", { "tw-w-full": n.showPresetAmounts }]),
456
459
  "data-testid": "bp-lend-cta-lend-again-button",
457
460
  type: "submit"
458
461
  }, {
459
- default: r(() => [
462
+ default: d(() => [
460
463
  c(m(n.primaryButtonText || "Lend") + " again ", 1)
461
464
  ]),
462
465
  _: 1
@@ -475,7 +478,7 @@ function U(e, s, n, k, f, t) {
475
478
  key: 3,
476
479
  class: "tw-inline-flex tw-flex-1"
477
480
  }, {
478
- default: r(() => s[6] || (s[6] = [
481
+ default: d(() => s[6] || (s[6] = [
479
482
  c(" Adding to basket ")
480
483
  ])),
481
484
  _: 1
@@ -484,7 +487,7 @@ function U(e, s, n, k, f, t) {
484
487
  ], 32)) : u("", !0)
485
488
  ]);
486
489
  }
487
- const Z = /* @__PURE__ */ F(I, [["render", U], ["__scopeId", "data-v-e8a71378"]]);
490
+ const Z = /* @__PURE__ */ F(I, [["render", U], ["__scopeId", "data-v-74dcdf98"]]);
488
491
  export {
489
492
  Z as default
490
493
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "5.3.1",
3
+ "version": "5.3.3",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -106,5 +106,5 @@
106
106
  "embla-carousel-fade",
107
107
  "popper.js"
108
108
  ],
109
- "gitHead": "88b1926c2f4cd748e6be886e11a5fd3843261cd2"
109
+ "gitHead": "ac1cad8ab1ea6d9d1274b97cf61febb26261d371"
110
110
  }