@kiva/kv-components 6.16.0 → 6.17.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 +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
+ .amountDropdownWrapper[data-v-8b9dbed8] select{border-radius:14px 0 0 14px}.lend-again[data-v-8b9dbed8] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-8b9dbed8] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-8b9dbed8] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-8b9dbed8] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-8b9dbed8] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-8b9dbed8] 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-8b9dbed8] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
@@ -6,17 +6,17 @@ 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 p, Fragment as L, renderList as g } from "vue";
9
+ import { resolveComponent as A, openBlock as i, createElementBlock as r, createBlock as a, withCtx as l, 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
- const k = "Other", oe = C`
12
+ const k = "Other", ot = C`
13
13
  fragment KvLendCta on LoanBasic {
14
14
  id
15
15
  name
16
16
  status
17
17
  minNoteSize
18
18
  }
19
- `, ie = C`
19
+ `, it = C`
20
20
  fragment KvLendCtaUser on LoanBasic {
21
21
  id
22
22
  userProperties {
@@ -135,7 +135,7 @@ const k = "Other", oe = C`
135
135
  }
136
136
  },
137
137
  data() {
138
- var e, n;
138
+ var t, n;
139
139
  return {
140
140
  mdiChevronRight: _,
141
141
  defaultAmountOptions: [25, 50, 75],
@@ -143,7 +143,7 @@ const k = "Other", oe = C`
143
143
  this.getCookie,
144
144
  this.setCookie,
145
145
  this.enableFiveDollarsNotes,
146
- (n = (e = this.route) == null ? void 0 : e.query) == null ? void 0 : n.utm_campaign,
146
+ (n = (t = this.route) == null ? void 0 : t.query) == null ? void 0 : n.utm_campaign,
147
147
  this.unreservedAmount,
148
148
  this.userBalance,
149
149
  this.fiveDollarsSelected
@@ -157,30 +157,30 @@ const k = "Other", oe = C`
157
157
  return this.customLoanDetails ? "" : `/lend/${this.loanId}`;
158
158
  },
159
159
  loanId() {
160
- var e;
161
- return (e = this.loan) == null ? void 0 : e.id;
160
+ var t;
161
+ return (t = this.loan) == null ? void 0 : t.id;
162
162
  },
163
163
  status() {
164
- var e;
165
- return ((e = this.loan) == null ? void 0 : e.status) ?? "";
164
+ var t;
165
+ return ((t = this.loan) == null ? void 0 : t.status) ?? "";
166
166
  },
167
167
  minNoteSize() {
168
- var e;
169
- return ((e = this.loan) == null ? void 0 : e.minNoteSize) ?? "";
168
+ var t;
169
+ return ((t = this.loan) == null ? void 0 : t.minNoteSize) ?? "";
170
170
  },
171
171
  lentPreviously() {
172
- var e, n;
173
- return ((n = (e = this.loan) == null ? void 0 : e.userProperties) == null ? void 0 : n.lentTo) ?? !1;
172
+ var t, n;
173
+ return ((n = (t = this.loan) == null ? void 0 : t.userProperties) == null ? void 0 : n.lentTo) ?? !1;
174
174
  },
175
175
  isInBasket() {
176
- var e;
177
- return ((e = this.basketItems) == null ? void 0 : e.some((n) => n.__typename === "LoanReservation" && n.id === this.loanId)) ?? !1;
176
+ var t;
177
+ return ((t = this.basketItems) == null ? void 0 : t.some((n) => n.__typename === "LoanReservation" && n.id === this.loanId)) ?? !1;
178
178
  },
179
179
  prices() {
180
- const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), n = D(
180
+ const t = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), n = D(
181
181
  this.unreservedAmount,
182
182
  this.isCompleteLoanActive,
183
- e,
183
+ t,
184
184
  this.enableFiveDollarsNotes,
185
185
  this.enableHugeAmount,
186
186
  this.isVisitor
@@ -188,22 +188,22 @@ const k = "Other", oe = C`
188
188
  return this.maxAmount ? n.filter((s) => parseFloat(s) <= parseFloat(this.maxAmount)) : n;
189
189
  },
190
190
  presetButtonsPrices() {
191
- const e = this.prices.slice(0, 3);
192
- return this.prices.length === 4 && e.push(this.prices[3]), e;
191
+ const t = this.prices.slice(0, 3);
192
+ return this.prices.length === 4 && t.push(this.prices[3]), t;
193
193
  },
194
194
  presetDropdownPrices() {
195
195
  if (this.prices.length === 4)
196
196
  return [];
197
- const e = this.prices.slice(this.defaultAmountOptions.length);
198
- return e.unshift(k), e;
197
+ const t = this.prices.slice(this.defaultAmountOptions.length);
198
+ return t.unshift(k), t;
199
199
  },
200
200
  loanName() {
201
- var e;
202
- return ((e = this.loan) == null ? void 0 : e.name) ?? "";
201
+ var t;
202
+ return ((t = this.loan) == null ? void 0 : t.name) ?? "";
203
203
  },
204
204
  presetAmountCtaButtonText() {
205
- var e;
206
- return ((e = this.loan) == null ? void 0 : e.borrowerCount) > 1 ? "Support" : `Support ${this.loanName}`;
205
+ var t;
206
+ return ((t = this.loan) == null ? void 0 : t.borrowerCount) > 1 ? "Support" : `Support ${this.loanName}`;
207
207
  },
208
208
  defaultCtaButtonText() {
209
209
  return this.showPresetAmounts ? this.presetAmountCtaButtonText : this.primaryButtonText || "Lend";
@@ -249,7 +249,8 @@ const k = "Other", oe = C`
249
249
  return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
250
250
  },
251
251
  isLendAmountButton() {
252
- return this.maxAmount ? !1 : (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
252
+ const t = this.maxAmount ? this.maxAmount : this.unreservedAmount;
253
+ return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(t) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
253
254
  },
254
255
  isFunded() {
255
256
  return this.state === "funded" || this.state === "fully-reserved";
@@ -257,6 +258,9 @@ const k = "Other", oe = C`
257
258
  amountToLend() {
258
259
  return this.selectedDropdown ? this.selectedDropdownOption : this.isLessThan25 ? this.unreservedAmount : this.selectedOption;
259
260
  },
261
+ amountForLendAmountButton() {
262
+ return this.maxAmount && parseFloat(this.maxAmount) === 25 ? Math.min(parseFloat(this.maxAmount), parseFloat(this.unreservedAmount)) : this.unreservedAmount;
263
+ },
260
264
  showLendAgain() {
261
265
  return this.isLentTo && !this.isLessThan25;
262
266
  },
@@ -267,18 +271,18 @@ const k = "Other", oe = C`
267
271
  return this.presetDropdownPrices.length > 1;
268
272
  },
269
273
  hideLendButton() {
270
- return this.maxAmount ? !1 : this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
274
+ return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
271
275
  }
272
276
  },
273
277
  watch: {
274
- unreservedAmount(e, n) {
275
- var s, A;
276
- e !== n && n === "" && (this.selectedOption = B(
278
+ unreservedAmount(t, n) {
279
+ var s, y;
280
+ t !== n && n === "" && (this.selectedOption = B(
277
281
  this.getCookie,
278
282
  this.setCookie,
279
283
  this.enableFiveDollarsNotes,
280
- (A = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : A.utm_campaign,
281
- e,
284
+ (y = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : y.utm_campaign,
285
+ t,
282
286
  this.userBalance,
283
287
  this.fiveDollarsSelected,
284
288
  this.showPresetAmounts
@@ -295,20 +299,20 @@ const k = "Other", oe = C`
295
299
  this.amountToLend
296
300
  ), this.$emit("add-to-basket", this.amountToLend);
297
301
  },
298
- isAmountLessThan25(e) {
299
- return e < 25 && e > 0;
302
+ isAmountLessThan25(t) {
303
+ return t < 25 && t > 0;
300
304
  },
301
- isAmountBetween25And50(e) {
302
- return e <= 50 && e > 25;
305
+ isAmountBetween25And50(t) {
306
+ return t <= 50 && t > 25;
303
307
  },
304
- isAmountBetween25And500(e) {
305
- return e < 500 && e >= 25;
308
+ isAmountBetween25And500(t) {
309
+ return t < 500 && t >= 25;
306
310
  },
307
- trackLendAmountSelection(e) {
311
+ trackLendAmountSelection(t) {
308
312
  this.showPresetAmounts && (this.selectedOption = null), this.kvTrackFunction(
309
313
  this.kvTrackCategory,
310
314
  "Modify lend amount",
311
- e,
315
+ t,
312
316
  this.loanId,
313
317
  this.loanId
314
318
  );
@@ -322,17 +326,17 @@ const k = "Other", oe = C`
322
326
  this.loanId
323
327
  );
324
328
  },
325
- clickSecondaryButton(e) {
326
- this.secondaryButtonHandler ? (e.preventDefault(), e.stopPropagation(), this.secondaryButtonHandler()) : this.handleCheckout();
329
+ clickSecondaryButton(t) {
330
+ this.secondaryButtonHandler ? (t.preventDefault(), t.stopPropagation(), this.secondaryButtonHandler()) : this.handleCheckout();
327
331
  },
328
- clickPresetButton(e) {
332
+ clickPresetButton(t) {
329
333
  this.kvTrackFunction(
330
334
  this.kvTrackCategory,
331
335
  "Modify lend amount",
332
- e,
336
+ t,
333
337
  this.loanId,
334
338
  this.loanId
335
- ), this.selectedOption = e, this.selectedDropdownOption = k;
339
+ ), this.selectedOption = t, this.selectedDropdownOption = k;
336
340
  },
337
341
  handleCheckout() {
338
342
  this.kvTrackFunction(
@@ -352,15 +356,15 @@ const k = "Other", oe = C`
352
356
  key: 1,
353
357
  class: "amountDropdownWrapper"
354
358
  }, z = ["value"];
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");
357
- return i(), l("div", H, [
359
+ function q(t, n, s, y, c, e) {
360
+ const b = A("kv-cart-pill"), m = A("kv-ui-button"), x = A("kv-material-icon"), v = A("kv-ui-select"), T = A("kv-lend-amount-button");
361
+ return i(), r("div", H, [
358
362
  s.showPill && s.showPresetAmounts ? (i(), a(b, {
359
363
  key: 0,
360
- "borrower-name": t.loanName,
364
+ "borrower-name": e.loanName,
361
365
  class: "!tw-w-full tw-justify-center tw-pb-2"
362
366
  }, {
363
- icon: r(() => n[5] || (n[5] = [
367
+ icon: l(() => n[5] || (n[5] = [
364
368
  u("svg", {
365
369
  xmlns: "http://www.w3.org/2000/svg",
366
370
  width: "25",
@@ -395,114 +399,114 @@ function q(e, n, s, A, c, t) {
395
399
  ])),
396
400
  _: 1
397
401
  }, 8, ["borrower-name"])) : d("", !0),
398
- t.isInBasket ? (i(), a(m, {
402
+ e.isInBasket ? (i(), a(m, {
399
403
  key: 1,
400
404
  variant: "secondary",
401
405
  class: h(["tw-inline-flex tw-flex-1", { "tw-w-full": s.showPresetAmounts }]),
402
406
  "data-testid": "bp-lend-cta-checkout-button",
403
407
  to: s.externalLinks ? void 0 : "/basket",
404
408
  href: s.externalLinks ? "/basket" : void 0,
405
- onClick: n[0] || (n[0] = (o) => t.clickSecondaryButton(o))
409
+ onClick: n[0] || (n[0] = (o) => e.clickSecondaryButton(o))
406
410
  }, {
407
- default: r(() => [
408
- f(w(t.loanInBasketButtonText), 1)
411
+ default: l(() => [
412
+ f(w(e.loanInBasketButtonText), 1)
409
413
  ]),
410
414
  _: 1
411
- }, 8, ["class", "to", "href"])) : t.showNonActionableLoanButton ? (i(), a(m, {
415
+ }, 8, ["class", "to", "href"])) : e.showNonActionableLoanButton ? (i(), a(m, {
412
416
  key: 2,
413
417
  class: "tw-inline-flex tw-flex-1"
414
418
  }, {
415
- default: r(() => [
416
- f(w(t.ctaButtonText), 1)
419
+ default: l(() => [
420
+ f(w(e.ctaButtonText), 1)
417
421
  ]),
418
422
  _: 1
419
- })) : t.isFunded ? (i(), l("div", K, " This loan was just funded! 🎉 ")) : s.showViewLoan ? (i(), a(m, {
423
+ })) : e.isFunded ? (i(), r("div", K, " This loan was just funded! 🎉 ")) : s.showViewLoan ? (i(), a(m, {
420
424
  key: 4,
421
- state: `${t.allSharesReserved ? "disabled" : ""}`,
422
- to: s.externalLinks ? void 0 : t.readMorePath,
423
- href: s.externalLinks ? t.readMorePath : void 0,
425
+ state: `${e.allSharesReserved ? "disabled" : ""}`,
426
+ to: s.externalLinks ? void 0 : e.readMorePath,
427
+ href: s.externalLinks ? e.readMorePath : void 0,
424
428
  class: "tw-mb-0",
425
- onClick: n[1] || (n[1] = (o) => e.$emit("show-loan-details", o))
429
+ onClick: n[1] || (n[1] = (o) => t.$emit("show-loan-details", o))
426
430
  }, {
427
- default: r(() => [
431
+ default: l(() => [
428
432
  u("span", R, [
429
433
  n[6] || (n[6] = f(" View loan ")),
430
- V(T, {
434
+ V(x, {
431
435
  class: "tw-w-3 tw-h-3 tw-align-middle",
432
436
  icon: c.mdiChevronRight
433
437
  }, null, 8, ["icon"])
434
438
  ])
435
439
  ]),
436
440
  _: 1
437
- }, 8, ["state", "to", "href"])) : t.useFormSubmit ? (i(), l("form", {
441
+ }, 8, ["state", "to", "href"])) : e.useFormSubmit ? (i(), r("form", {
438
442
  key: 5,
439
443
  class: "tw-w-full tw-flex",
440
- onSubmit: n[4] || (n[4] = p((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
444
+ onSubmit: n[4] || (n[4] = p((...o) => e.addToBasket && e.addToBasket(...o), ["prevent"]))
441
445
  }, [
442
446
  u("fieldset", {
443
447
  class: h(["tw-w-full tw-flex", {
444
448
  "tw-flex-col md:tw-flex-row md:tw-justify-between": s.showPresetAmounts,
445
- "tw-gap-1.5": s.showPresetAmounts && !t.isLendAmountButton
449
+ "tw-gap-1.5": s.showPresetAmounts && !e.isLendAmountButton
446
450
  }]),
447
451
  disabled: s.isAdding,
448
452
  "data-testid": "bp-lend-cta-select-and-button"
449
453
  }, [
450
- s.showPresetAmounts && !s.isAdding ? (i(), l("div", {
454
+ s.showPresetAmounts && !s.isAdding ? (i(), r("div", {
451
455
  key: 0,
452
456
  class: h(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": s.enableHugeAmount }])
453
457
  }, [
454
- t.isLendAmountButton ? d("", !0) : (i(!0), l(L, { key: 0 }, g(t.presetButtonsPrices, (o) => (i(), a(m, {
458
+ e.isLendAmountButton ? d("", !0) : (i(!0), r(L, { key: 0 }, g(e.presetButtonsPrices, (o) => (i(), a(m, {
455
459
  key: o,
456
460
  variant: "secondary",
457
461
  class: h(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": c.selectedOption == o }]),
458
462
  "data-testid": "bp-lend-cta-lend-button",
459
- onClick: (Z) => t.clickPresetButton(o)
463
+ onClick: (Z) => e.clickPresetButton(o)
460
464
  }, {
461
- default: r(() => [
465
+ default: l(() => [
462
466
  f(" $" + w(o), 1)
463
467
  ]),
464
468
  _: 2
465
469
  }, 1032, ["class", "onClick"]))), 128)),
466
- t.showFilteredDropdown ? (i(), a(v, {
470
+ e.showFilteredDropdown ? (i(), a(v, {
467
471
  key: 1,
468
- id: `LoanAmountDropdown_${t.loanId}`,
472
+ id: `LoanAmountDropdown_${e.loanId}`,
469
473
  modelValue: c.selectedDropdownOption,
470
474
  "onUpdate:modelValue": [
471
475
  n[2] || (n[2] = (o) => c.selectedDropdownOption = o),
472
- t.trackLendAmountSelection
476
+ e.trackLendAmountSelection
473
477
  ],
474
478
  class: h(["tw-min-w-12 tw-rounded filtered-dropdown", {
475
- "unselected-dropdown": !t.selectedDropdown,
476
- "selected-dropdown": t.selectedDropdown,
479
+ "unselected-dropdown": !e.selectedDropdown,
480
+ "selected-dropdown": e.selectedDropdown,
477
481
  "tw-w-full": s.enableHugeAmount
478
482
  }]),
479
483
  "aria-label": "Lend amount",
480
- onClick: p(t.clickDropdown, ["stop"])
484
+ onClick: p(e.clickDropdown, ["stop"])
481
485
  }, {
482
- default: r(() => [
483
- (i(!0), l(L, null, g(t.presetDropdownPrices, (o) => (i(), l("option", {
486
+ default: l(() => [
487
+ (i(!0), r(L, null, g(e.presetDropdownPrices, (o) => (i(), r("option", {
484
488
  key: o,
485
489
  value: o
486
490
  }, w(o !== c.OTHER_OPTION ? `$${o}` : o), 9, E))), 128))
487
491
  ]),
488
492
  _: 1
489
493
  }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : d("", !0)
490
- ], 2)) : s.showPresetAmounts ? d("", !0) : (i(), l("div", j, [
491
- t.hideShowLendDropdown && !t.isLessThan25 ? (i(), a(v, {
494
+ ], 2)) : s.showPresetAmounts ? d("", !0) : (i(), r("div", j, [
495
+ e.hideShowLendDropdown && !e.isLessThan25 ? (i(), a(v, {
492
496
  key: 0,
493
- id: `LoanAmountDropdown_${t.loanId}`,
497
+ id: `LoanAmountDropdown_${e.loanId}`,
494
498
  modelValue: c.selectedOption,
495
499
  "onUpdate:modelValue": [
496
500
  n[3] || (n[3] = (o) => c.selectedOption = o),
497
- t.trackLendAmountSelection
501
+ e.trackLendAmountSelection
498
502
  ],
499
503
  class: "tw-min-w-12",
500
504
  style: { "border-radius": "14px 0 0 14px" },
501
505
  "aria-label": "Lend amount",
502
- onClick: p(t.clickDropdown, ["stop"])
506
+ onClick: p(e.clickDropdown, ["stop"])
503
507
  }, {
504
- default: r(() => [
505
- (i(!0), l(L, null, g(t.prices, (o) => (i(), l("option", {
508
+ default: l(() => [
509
+ (i(!0), r(L, null, g(e.prices, (o) => (i(), r("option", {
506
510
  key: o,
507
511
  value: o
508
512
  }, " $" + w(o), 9, z))), 128))
@@ -512,46 +516,46 @@ function q(e, n, s, A, c, t) {
512
516
  ])),
513
517
  u("div", {
514
518
  class: h({
515
- lendButtonWrapper: t.hideShowLendDropdown && !s.showPresetAmounts,
516
- "tw-hidden": t.hideLendButton
519
+ lendButtonWrapper: e.hideShowLendDropdown && !s.showPresetAmounts,
520
+ "tw-hidden": e.hideLendButton
517
521
  })
518
522
  }, [
519
- t.lendButtonVisibility && !t.isLessThan25 ? (i(), a(m, {
523
+ e.lendButtonVisibility && !e.isLessThan25 ? (i(), a(m, {
520
524
  key: "lendButton",
521
525
  class: h(["tw-inline-flex tw-flex-1", { "tw-w-full": s.showPresetAmounts }]),
522
526
  "data-testid": "bp-lend-cta-lend-button",
523
527
  type: "submit"
524
528
  }, {
525
- default: r(() => [
526
- f(w(t.ctaButtonText), 1)
529
+ default: l(() => [
530
+ f(w(e.ctaButtonText), 1)
527
531
  ]),
528
532
  _: 1
529
- }, 8, ["class"])) : t.showLendAgain ? (i(), a(m, {
533
+ }, 8, ["class"])) : e.showLendAgain ? (i(), a(m, {
530
534
  key: "lendAgainButton",
531
535
  class: h(["lend-again", { "tw-w-full": s.showPresetAmounts }]),
532
536
  "data-testid": "bp-lend-cta-lend-again-button",
533
537
  type: "submit"
534
538
  }, {
535
- default: r(() => [
539
+ default: l(() => [
536
540
  f(w(s.primaryButtonText || "Lend") + " again ", 1)
537
541
  ]),
538
542
  _: 1
539
543
  }, 8, ["class"])) : d("", !0)
540
544
  ], 2),
541
- t.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(x, {
545
+ e.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(T, {
542
546
  key: 2,
543
547
  class: "tw-w-full",
544
- "loan-id": t.loanId,
548
+ "loan-id": e.loanId,
545
549
  "show-now": !1,
546
- "amount-left": s.unreservedAmount,
550
+ "amount-left": e.amountForLendAmountButton,
547
551
  "is-adding": s.isAdding,
548
- onAddToBasket: t.addToBasket
552
+ onAddToBasket: e.addToBasket
549
553
  }, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : d("", !0),
550
554
  !s.isLoading && s.isAdding ? (i(), a(m, {
551
555
  key: 3,
552
556
  class: "tw-inline-flex tw-flex-1"
553
557
  }, {
554
- default: r(() => n[7] || (n[7] = [
558
+ default: l(() => n[7] || (n[7] = [
555
559
  f(" Adding to basket ")
556
560
  ])),
557
561
  _: 1
@@ -560,9 +564,9 @@ function q(e, n, s, A, c, t) {
560
564
  ], 32)) : d("", !0)
561
565
  ]);
562
566
  }
563
- const ae = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-e06394ac"]]);
567
+ const at = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-8b9dbed8"]]);
564
568
  export {
565
- oe as KV_LEND_CTA_FRAGMENT,
566
- ie as KV_LEND_CTA_USER_FRAGMENT,
567
- ae as default
569
+ ot as KV_LEND_CTA_FRAGMENT,
570
+ it as KV_LEND_CTA_USER_FRAGMENT,
571
+ at as default
568
572
  };
@@ -1,10 +1,10 @@
1
- import { toRefs as T, ref as f, watch as E, resolveComponent as B, openBlock as g, createElementBlock as S, normalizeClass as c, withModifiers as _, createElementVNode as d, normalizeStyle as z, createVNode as b, createCommentVNode as C, renderSlot as F } from "vue";
2
- import { mdiClose as K, mdiLaunch as N } from "@mdi/js";
3
- import V from "./KvMaterialIcon.js";
4
- import j from "../_virtual/_plugin-vue_export-helper.js";
1
+ import { toRefs as T, ref as h, watch as B, resolveComponent as _, openBlock as d, createElementBlock as f, normalizeClass as r, withModifiers as j, createElementVNode as a, normalizeStyle as V, createVNode as v, toDisplayString as z, createCommentVNode as u, renderSlot as C } from "vue";
2
+ import { mdiClose as F, mdiArrowLeft as K, mdiExportVariant as N } from "@mdi/js";
3
+ import R from "./KvMaterialIcon.js";
4
+ import A from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const G = {
6
6
  components: {
7
- KvMaterialIcon: V
7
+ KvMaterialIcon: R
8
8
  },
9
9
  props: {
10
10
  /**
@@ -41,6 +41,13 @@ const G = {
41
41
  animationSourceElement: {
42
42
  type: Object,
43
43
  default: () => ({})
44
+ },
45
+ /**
46
+ * The headline of the side sheet
47
+ */
48
+ headline: {
49
+ type: String,
50
+ default: ""
44
51
  }
45
52
  },
46
53
  emits: [
@@ -48,116 +55,146 @@ const G = {
48
55
  ],
49
56
  setup(w, { emit: o }) {
50
57
  const {
51
- visible: a,
58
+ visible: s,
52
59
  kvTrackFunction: t,
53
- trackEventCategory: m,
54
- animationSourceElement: r
55
- } = T(w), n = f(!1), i = f({}), s = f({});
56
- let u = null;
57
- const v = () => {
58
- const l = "tw-overflow-hidden";
59
- n.value ? document.body.classList.add(l) : document.body.classList.remove(l);
60
- }, y = () => {
61
- n.value = !1, v(), t.value(m.value, "click", "side-sheet-closed"), r.value && (s.value = {
60
+ trackEventCategory: p,
61
+ animationSourceElement: y
62
+ } = T(w), l = h(!1), i = h({}), c = h({});
63
+ let m = null;
64
+ const g = () => {
65
+ const n = "tw-overflow-hidden";
66
+ l.value ? document.body.classList.add(n) : document.body.classList.remove(n);
67
+ }, k = () => {
68
+ l.value = !1, g(), t.value(p.value, "click", "side-sheet-closed"), y.value && (c.value = {
62
69
  ...i.value,
63
70
  transition: "all 0.5s ease-in-out"
64
71
  }), setTimeout(() => {
65
72
  o("side-sheet-closed");
66
- }, "700"), document.removeEventListener("keyup", u);
67
- }, x = () => {
73
+ }, "700"), document.removeEventListener("keyup", m);
74
+ }, E = () => {
68
75
  o("go-to-link");
69
76
  };
70
- return u = (l) => {
71
- l && l.key === "Escape" && y();
72
- }, E(a, () => {
73
- var l;
74
- if (a.value) {
75
- document.addEventListener("keyup", u), setTimeout(() => {
76
- n.value = !0, v();
77
+ return m = (n) => {
78
+ n && n.key === "Escape" && k();
79
+ }, B(s, () => {
80
+ var n;
81
+ if (s.value) {
82
+ document.addEventListener("keyup", m), setTimeout(() => {
83
+ l.value = !0, g();
77
84
  }, 100);
78
- const e = (l = r.value) == null ? void 0 : l.getBoundingClientRect(), h = (e == null ? void 0 : e.top) ?? 0, L = (e == null ? void 0 : e.left) ?? 0, p = (e == null ? void 0 : e.width) ?? 0, k = (e == null ? void 0 : e.height) ?? 0;
79
- h || L || p || k ? (i.value = {
85
+ const e = (n = y.value) == null ? void 0 : n.getBoundingClientRect(), S = (e == null ? void 0 : e.top) ?? 0, L = (e == null ? void 0 : e.left) ?? 0, b = (e == null ? void 0 : e.width) ?? 0, x = (e == null ? void 0 : e.height) ?? 0;
86
+ S || L || b || x ? (i.value = {
80
87
  position: "fixed",
81
- top: `${h}px`,
82
- width: `${p}px`,
83
- height: `${k}px`
84
- }, s.value = {
88
+ top: `${S}px`,
89
+ width: `${b}px`,
90
+ height: `${x}px`
91
+ }, c.value = {
85
92
  ...i.value,
86
93
  transition: "none"
87
94
  }, setTimeout(() => {
88
- s.value = {
95
+ c.value = {
89
96
  top: "0",
90
97
  width: "100%",
91
98
  height: "100%",
92
99
  transition: "all 0.5s ease-in-out"
93
100
  };
94
- }, 10)) : s.value = {};
101
+ }, 10)) : c.value = {};
95
102
  }
96
103
  }), {
97
- mdiClose: K,
98
- mdiLaunch: N,
99
- open: n,
100
- closeSideSheet: y,
101
- goToLink: x,
102
- modalStyles: s
104
+ mdiClose: F,
105
+ mdiArrowLeft: K,
106
+ mdiExportVariant: N,
107
+ open: l,
108
+ closeSideSheet: k,
109
+ goToLink: E,
110
+ modalStyles: c
103
111
  };
104
112
  }
105
- };
106
- function M(w, o, a, t, m, r) {
107
- const n = B("kv-material-icon");
108
- return a.visible ? (g(), S("div", {
113
+ }, M = { class: "tw-flex tw-items-cente tw-gap-1.5" }, D = { key: 0 }, I = { class: "tw-flex tw-items-cente tw-gap-1.5" };
114
+ function O(w, o, s, t, p, y) {
115
+ const l = _("kv-material-icon");
116
+ return s.visible ? (d(), f("div", {
109
117
  key: 0,
110
- class: c(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
118
+ class: r(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
111
119
  "tw-bg-opacity-0 tw-delay-300": !t.open,
112
120
  "tw-bg-opacity-low": t.open
113
121
  }]),
114
- onClick: o[2] || (o[2] = _((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
122
+ onClick: o[3] || (o[3] = j((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
115
123
  }, [
116
- d("div", {
117
- class: c(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto tw-p-2", {
124
+ a("div", {
125
+ class: r(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
118
126
  "tw-w-0 tw-delay-200 tw-opacity-0": !t.open,
119
- "lg:tw-w-1/2 tw-w-full tw-opacity-full": t.open
120
- }]),
121
- style: z(t.modalStyles)
127
+ "lg:tw-w-1/2 tw-w-full tw-opacity-full": t.open,
128
+ "tw-h-full": w.$slots.controls
129
+ }])
122
130
  }, [
123
- d("div", {
124
- class: c(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200", {
125
- "tw-opacity-0": !t.open,
126
- "tw-opacity-full": t.open
127
- }])
131
+ a("div", {
132
+ class: "tw-relative tw-h-full",
133
+ style: V(t.modalStyles)
128
134
  }, [
129
- d("button", {
130
- class: "hover:tw-text-action-highlight",
131
- onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
135
+ a("div", {
136
+ class: r(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200 tw-px-3 tw-py-2 tw-border-b tw-border-tertiary", {
137
+ "tw-opacity-0": !t.open,
138
+ "tw-opacity-full": t.open
139
+ }])
132
140
  }, [
133
- b(n, {
134
- class: "tw-w-3 tw-h-3",
135
- icon: t.mdiClose
136
- }, null, 8, ["icon"])
137
- ]),
138
- a.showGoToLink ? (g(), S("button", {
141
+ a("div", M, [
142
+ a("button", {
143
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
144
+ onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
145
+ }, [
146
+ v(l, {
147
+ class: "tw-w-3 tw-h-3",
148
+ icon: t.mdiArrowLeft
149
+ }, null, 8, ["icon"])
150
+ ]),
151
+ s.headline ? (d(), f("h2", D, z(s.headline), 1)) : u("", !0)
152
+ ]),
153
+ a("div", I, [
154
+ s.showGoToLink ? (d(), f("button", {
155
+ key: 0,
156
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
157
+ onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
158
+ }, [
159
+ v(l, {
160
+ class: "tw-w-3 tw-h-3",
161
+ icon: t.mdiExportVariant
162
+ }, null, 8, ["icon"])
163
+ ])) : u("", !0),
164
+ a("button", {
165
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
166
+ onClick: o[2] || (o[2] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
167
+ }, [
168
+ v(l, {
169
+ class: "tw-w-3 tw-h-3",
170
+ icon: t.mdiClose
171
+ }, null, 8, ["icon"])
172
+ ])
173
+ ])
174
+ ], 2),
175
+ a("div", {
176
+ class: r(["tw-p-4 tw-overflow-y-auto tw-transition-opacity tw-duration-500 tw-delay-200 tw-overscroll-y-contain", {
177
+ "tw-opacity-0": !t.open,
178
+ "tw-opacity-full": t.open
179
+ }])
180
+ }, [
181
+ C(w.$slots, "default")
182
+ ], 2),
183
+ w.$slots.controls ? (d(), f("div", {
139
184
  key: 0,
140
- class: "hover:tw-text-action-highlight",
141
- onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
185
+ ref: "controlsRef",
186
+ class: r(["tw-absolute tw-border-t tw-border-tertiary tw-w-full tw-bottom-0 tw-bg-white", {
187
+ "tw-opacity-0": !t.open,
188
+ "tw-opacity-full": t.open
189
+ }])
142
190
  }, [
143
- b(n, {
144
- class: "tw-w-3 tw-h-3",
145
- icon: t.mdiLaunch
146
- }, null, 8, ["icon"])
147
- ])) : C("", !0)
148
- ], 2),
149
- d("div", {
150
- class: c(["tw-p-4 tw-overflow-y-auto tw-transition-opacity tw-duration-500 tw-delay-200 tw-overscroll-y-contain", {
151
- "tw-opacity-0": !t.open,
152
- "tw-opacity-full": t.open
153
- }])
154
- }, [
155
- F(w.$slots, "default")
156
- ], 2)
157
- ], 6)
158
- ], 2)) : C("", !0);
191
+ C(w.$slots, "controls")
192
+ ], 2)) : u("", !0)
193
+ ], 4)
194
+ ], 2)
195
+ ], 2)) : u("", !0);
159
196
  }
160
- const q = /* @__PURE__ */ j(G, [["render", M]]);
197
+ const P = /* @__PURE__ */ A(G, [["render", O]]);
161
198
  export {
162
- q as default
199
+ P as default
163
200
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.16.0",
3
+ "version": "6.17.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": "6b563c82fd8270b4df50c76da70eed7f2c82b908"
114
+ "gitHead": "a1edf8cf5d70ab233c93d312548a73475308a33a"
115
115
  }