@kiva/kv-components 6.14.1 → 6.15.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.
@@ -1,9 +1,9 @@
1
- const C = `M5.20211 3.41369C7.95289 5.46723 10.913 9.62944 11.9996 11.8624C13.0852 9.62857 16.0453
2
- 5.46636 18.7979 3.41369C20.7837 1.93325 24 0.787045 24 4.43303C24 5.161 23.5804 10.5517 23.3331 11.4275C22.4762
3
- 14.4698 19.3553 15.245 16.578 14.7751C21.4321 15.5958 22.667 18.3152 20.0001 21.0346C14.9358 26.1995 12.7213
4
- 19.7388 12.1541 18.0842C11.9898 17.6074 12.0146 17.5969 11.8459 18.0842C11.2787 19.7397 9.06415 26.1995 3.99985
5
- 21.0346C1.33299 18.3152 2.56793 15.5967 7.42199 14.7751C4.64471 15.245 1.52291 14.4689 0.666937 11.4275C0.419596
6
- 10.5517 0 5.161 0 4.43303C0 0.786169 3.2172 1.93237 5.20211 3.41369Z
1
+ const C = `M6.90158 6.00978C8.96467 7.4766 11.1848 10.4496 11.9997 12.0446C12.8139 10.449 15.034
2
+ 7.47597 17.0984 6.00978C18.5878 4.95232 21 4.1336 21 6.73788C21 7.25786 20.6853 11.1084 20.4998 11.7339C19.8571
3
+ 13.907 17.5165 14.4607 15.4335 14.1251C19.0741 14.7113 20.0002 16.6537 18.0001 18.5962C14.2018 22.2854 12.541
4
+ 17.6706 12.1156 16.4887C11.9924 16.1482 12.0109 16.1407 11.8844 16.4887C11.459 17.6712 9.79811 22.2854 5.99989
5
+ 18.5962C3.99974 16.6537 4.92595 14.7119 8.56649 14.1251C6.48353 14.4607 4.14218 13.9064 3.5002 11.7339C3.3147
6
+ 11.1084 3 7.25786 3 6.73788C3 4.13298 5.4129 4.95169 6.90158 6.00978Z
7
7
  `;
8
8
  export {
9
9
  C as KvBlueskyIcon
@@ -1 +1 @@
1
- .amountDropdownWrapper[data-v-1ac5c3c8] select{border-radius:14px 0 0 14px}.lend-again[data-v-1ac5c3c8] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-1ac5c3c8] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-1ac5c3c8] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-1ac5c3c8] 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-1ac5c3c8] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
1
+ .amountDropdownWrapper[data-v-e06394ac] select{border-radius:14px 0 0 14px}.lend-again[data-v-e06394ac] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-e06394ac] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-e06394ac] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-e06394ac] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-e06394ac] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-e06394ac] 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-e06394ac] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
@@ -1,12 +1,12 @@
1
1
  import C from "graphql-tag";
2
- import { mdiChevronRight as x } from "@mdi/js";
2
+ import { mdiChevronRight as _ } from "@mdi/js";
3
3
  import { getLendCtaSelectedOption as B, getDropdownPriceArray as D } from "../utils/loanUtils.js";
4
4
  import P from "./KvLendAmountButton.js";
5
5
  import S from "./KvSelect.js";
6
6
  import F from "./KvButton.js";
7
7
  import I from "./KvMaterialIcon.js";
8
8
  import N from "./KvCartPill.js";
9
- import { resolveComponent as y, openBlock as i, createElementBlock as l, createBlock as a, withCtx as r, createElementVNode as u, createCommentVNode as d, normalizeClass as h, createTextVNode as f, toDisplayString as w, createVNode as V, withModifiers as A, Fragment as g, renderList as p } from "vue";
9
+ import { resolveComponent as y, openBlock as i, createElementBlock as l, createBlock as a, withCtx as r, createElementVNode as u, createCommentVNode as d, normalizeClass as h, createTextVNode as f, toDisplayString as w, createVNode as V, withModifiers as p, Fragment as L, renderList as g } from "vue";
10
10
  import "./KvLendCta.css";
11
11
  import O from "../_virtual/_plugin-vue_export-helper.js";
12
12
  const k = "Other", oe = C`
@@ -113,6 +113,14 @@ const k = "Other", oe = C`
113
113
  type: Function,
114
114
  default: void 0
115
115
  },
116
+ /**
117
+ * Hide preset buttons under this amount when
118
+ * showPresetAmounts is true
119
+ * */
120
+ maxAmount: {
121
+ type: String,
122
+ default: ""
123
+ },
116
124
  showPresetAmounts: {
117
125
  type: Boolean,
118
126
  default: !1
@@ -129,7 +137,7 @@ const k = "Other", oe = C`
129
137
  data() {
130
138
  var e, n;
131
139
  return {
132
- mdiChevronRight: x,
140
+ mdiChevronRight: _,
133
141
  defaultAmountOptions: [25, 50, 75],
134
142
  selectedOption: B(
135
143
  this.getCookie,
@@ -169,8 +177,7 @@ const k = "Other", oe = C`
169
177
  return ((e = this.basketItems) == null ? void 0 : e.some((n) => n.__typename === "LoanReservation" && n.id === this.loanId)) ?? !1;
170
178
  },
171
179
  prices() {
172
- const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25);
173
- return D(
180
+ const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), n = D(
174
181
  this.unreservedAmount,
175
182
  this.isCompleteLoanActive,
176
183
  e,
@@ -178,6 +185,7 @@ const k = "Other", oe = C`
178
185
  this.enableHugeAmount,
179
186
  this.isVisitor
180
187
  );
188
+ return this.maxAmount ? n.filter((s) => parseFloat(s) <= parseFloat(this.maxAmount)) : n;
181
189
  },
182
190
  presetButtonsPrices() {
183
191
  const e = this.prices.slice(0, 3);
@@ -241,7 +249,7 @@ const k = "Other", oe = C`
241
249
  return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
242
250
  },
243
251
  isLendAmountButton() {
244
- return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
252
+ return this.maxAmount ? !1 : (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
245
253
  },
246
254
  isFunded() {
247
255
  return this.state === "funded" || this.state === "fully-reserved";
@@ -259,17 +267,17 @@ const k = "Other", oe = C`
259
267
  return this.presetDropdownPrices.length > 1;
260
268
  },
261
269
  hideLendButton() {
262
- return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
270
+ return this.maxAmount ? !1 : this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
263
271
  }
264
272
  },
265
273
  watch: {
266
274
  unreservedAmount(e, n) {
267
- var s, L;
275
+ var s, A;
268
276
  e !== n && n === "" && (this.selectedOption = B(
269
277
  this.getCookie,
270
278
  this.setCookie,
271
279
  this.enableFiveDollarsNotes,
272
- (L = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : L.utm_campaign,
280
+ (A = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : A.utm_campaign,
273
281
  e,
274
282
  this.userBalance,
275
283
  this.fiveDollarsSelected,
@@ -344,8 +352,8 @@ const k = "Other", oe = C`
344
352
  key: 1,
345
353
  class: "amountDropdownWrapper"
346
354
  }, z = ["value"];
347
- function q(e, n, s, L, c, t) {
348
- const b = y("kv-cart-pill"), m = y("kv-ui-button"), T = y("kv-material-icon"), v = y("kv-ui-select"), _ = y("kv-lend-amount-button");
355
+ function q(e, n, s, A, c, t) {
356
+ const b = y("kv-cart-pill"), m = y("kv-ui-button"), T = y("kv-material-icon"), v = y("kv-ui-select"), x = y("kv-lend-amount-button");
349
357
  return i(), l("div", H, [
350
358
  s.showPill && s.showPresetAmounts ? (i(), a(b, {
351
359
  key: 0,
@@ -429,7 +437,7 @@ function q(e, n, s, L, c, t) {
429
437
  }, 8, ["state", "to", "href"])) : t.useFormSubmit ? (i(), l("form", {
430
438
  key: 5,
431
439
  class: "tw-w-full tw-flex",
432
- onSubmit: n[4] || (n[4] = A((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
440
+ onSubmit: n[4] || (n[4] = p((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
433
441
  }, [
434
442
  u("fieldset", {
435
443
  class: h(["tw-w-full tw-flex", {
@@ -443,7 +451,7 @@ function q(e, n, s, L, c, t) {
443
451
  key: 0,
444
452
  class: h(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": s.enableHugeAmount }])
445
453
  }, [
446
- t.isLendAmountButton ? d("", !0) : (i(!0), l(g, { key: 0 }, p(t.presetButtonsPrices, (o) => (i(), a(m, {
454
+ t.isLendAmountButton ? d("", !0) : (i(!0), l(L, { key: 0 }, g(t.presetButtonsPrices, (o) => (i(), a(m, {
447
455
  key: o,
448
456
  variant: "secondary",
449
457
  class: h(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": c.selectedOption == o }]),
@@ -469,10 +477,10 @@ function q(e, n, s, L, c, t) {
469
477
  "tw-w-full": s.enableHugeAmount
470
478
  }]),
471
479
  "aria-label": "Lend amount",
472
- onClick: A(t.clickDropdown, ["stop"])
480
+ onClick: p(t.clickDropdown, ["stop"])
473
481
  }, {
474
482
  default: r(() => [
475
- (i(!0), l(g, null, p(t.presetDropdownPrices, (o) => (i(), l("option", {
483
+ (i(!0), l(L, null, g(t.presetDropdownPrices, (o) => (i(), l("option", {
476
484
  key: o,
477
485
  value: o
478
486
  }, w(o !== c.OTHER_OPTION ? `$${o}` : o), 9, E))), 128))
@@ -491,10 +499,10 @@ function q(e, n, s, L, c, t) {
491
499
  class: "tw-min-w-12",
492
500
  style: { "border-radius": "14px 0 0 14px" },
493
501
  "aria-label": "Lend amount",
494
- onClick: A(t.clickDropdown, ["stop"])
502
+ onClick: p(t.clickDropdown, ["stop"])
495
503
  }, {
496
504
  default: r(() => [
497
- (i(!0), l(g, null, p(t.prices, (o) => (i(), l("option", {
505
+ (i(!0), l(L, null, g(t.prices, (o) => (i(), l("option", {
498
506
  key: o,
499
507
  value: o
500
508
  }, " $" + w(o), 9, z))), 128))
@@ -530,7 +538,7 @@ function q(e, n, s, L, c, t) {
530
538
  _: 1
531
539
  }, 8, ["class"])) : d("", !0)
532
540
  ], 2),
533
- t.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(_, {
541
+ t.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(x, {
534
542
  key: 2,
535
543
  class: "tw-w-full",
536
544
  "loan-id": t.loanId,
@@ -552,7 +560,7 @@ function q(e, n, s, L, c, t) {
552
560
  ], 32)) : d("", !0)
553
561
  ]);
554
562
  }
555
- const ae = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-1ac5c3c8"]]);
563
+ const ae = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-e06394ac"]]);
556
564
  export {
557
565
  oe as KV_LEND_CTA_FRAGMENT,
558
566
  ie as KV_LEND_CTA_USER_FRAGMENT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.14.1",
3
+ "version": "6.15.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -111,5 +111,5 @@
111
111
  "embla-carousel-fade",
112
112
  "popper.js"
113
113
  ],
114
- "gitHead": "6c20b8e7fa9b609fbbcac4d9f606e03bd9eb4e72"
114
+ "gitHead": "fc3d3bc5b4c6f79106de5171f728cf404483d81b"
115
115
  }