@kiva/kv-components 6.13.2 → 6.14.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,12 +1,34 @@
1
- import { parseISO as s, differenceInDays as d } from "date-fns";
2
- import m from "numeral";
3
- import c from "./KvCountdownTimer.js";
4
- import { resolveComponent as f, openBlock as i, createElementBlock as p, normalizeStyle as h, createTextVNode as x, toDisplayString as g, createBlock as y, createCommentVNode as l } from "vue";
5
- import v from "../_virtual/_plugin-vue_export-helper.js";
6
- const E = "N/A", _ = {
1
+ import { parseISO as s, differenceInDays as m } from "date-fns";
2
+ import c from "graphql-tag";
3
+ import p from "numeral";
4
+ import f from "./KvCountdownTimer.js";
5
+ import { resolveComponent as h, openBlock as d, createElementBlock as g, normalizeStyle as L, createTextVNode as x, toDisplayString as A, createBlock as v, createCommentVNode as l } from "vue";
6
+ import _ from "../_virtual/_plugin-vue_export-helper.js";
7
+ const y = "N/A", t = {
8
+ almostFunded: "almost-funded",
9
+ endingSoon: "ending-soon",
10
+ matchedLoan: "matched-loan",
11
+ lseLoan: "lse-loan"
12
+ }, I = c`
13
+ fragment KvLoanTag on LoanBasic {
14
+ id
15
+ loanFundraisingInfo {
16
+ id
17
+ fundedAmount
18
+ reservedAmount
19
+ }
20
+ loanAmount
21
+ matchRatio
22
+ matchingText
23
+ plannedExpirationDate
24
+ ... on LoanPartner {
25
+ partnerName
26
+ }
27
+ }
28
+ `, E = {
7
29
  name: "KvLoanTag",
8
30
  components: {
9
- KvCountdownTimer: c
31
+ KvCountdownTimer: f
10
32
  },
11
33
  props: {
12
34
  loan: {
@@ -24,27 +46,27 @@ const E = "N/A", _ = {
24
46
  return s((e = this.loan) == null ? void 0 : e.plannedExpirationDate);
25
47
  },
26
48
  isLseLoan() {
27
- var e, t;
28
- return ((t = (e = this.loan) == null ? void 0 : e.partnerName) == null ? void 0 : t.toUpperCase().includes(E)) ?? !1;
49
+ var e, n;
50
+ return ((n = (e = this.loan) == null ? void 0 : e.partnerName) == null ? void 0 : n.toUpperCase().includes(y)) ?? !1;
29
51
  },
30
52
  amountLeft() {
31
- var a, o;
32
- const e = ((a = this.loan) == null ? void 0 : a.loanFundraisingInfo) ?? { fundedAmount: 0, reservedAmount: 0 }, { fundedAmount: t, reservedAmount: r } = e;
33
- return m((o = this.loan) == null ? void 0 : o.loanAmount).subtract(t).subtract(r).value();
53
+ var o, r;
54
+ const e = ((o = this.loan) == null ? void 0 : o.loanFundraisingInfo) ?? { fundedAmount: 0, reservedAmount: 0 }, { fundedAmount: n, reservedAmount: i } = e;
55
+ return p((r = this.loan) == null ? void 0 : r.loanAmount).subtract(n).subtract(i).value();
34
56
  },
35
57
  variation() {
36
- var e, t;
37
- return (e = this.loan) != null && e.matchingText ? "matched-loan" : this.isLseLoan ? "lse-loan" : d(s((t = this.loan) == null ? void 0 : t.plannedExpirationDate), Date.now()) <= 3 ? "ending-soon" : this.amountLeft < 100 && this.amountLeft >= 0 ? "almost-funded" : null;
58
+ var e, n;
59
+ return (e = this.loan) != null && e.matchingText ? t.matchedLoan : this.isLseLoan ? t.lseLoan : m(s((n = this.loan) == null ? void 0 : n.plannedExpirationDate), Date.now()) <= 3 ? t.endingSoon : this.amountLeft < 100 && this.amountLeft >= 0 ? t.almostFunded : null;
38
60
  },
39
61
  tagText() {
40
62
  var e;
41
63
  switch (this.variation) {
42
- case "lse-loan":
64
+ case t.lseLoan:
43
65
  return `${this.useExpandedStyles ? "⚡ " : ""}High community impact`;
44
- case "almost-funded":
66
+ case t.almostFunded:
45
67
  return `${this.useExpandedStyles ? "💸 " : ""}Almost funded`;
46
68
  // eslint-disable-next-line max-len
47
- case "matched-loan":
69
+ case t.matchedLoan:
48
70
  return `${this.useExpandedStyles ? "🤝 " : ""}${this.matchRatio + 1}x matching by ${(e = this.loan) == null ? void 0 : e.matchingText}`;
49
71
  default:
50
72
  return `${this.useExpandedStyles ? "⏰ " : ""}Ending soon: `;
@@ -53,9 +75,9 @@ const E = "N/A", _ = {
53
75
  tagColor() {
54
76
  if (this.useExpandedStyles)
55
77
  switch (this.variation) {
56
- case "almost-funded":
78
+ case t.almostFunded:
57
79
  return "#AF741C";
58
- case "ending-soon":
80
+ case t.endingSoon:
59
81
  return "#CE2626";
60
82
  default:
61
83
  return "#2B7C5F";
@@ -68,21 +90,22 @@ const E = "N/A", _ = {
68
90
  }
69
91
  }
70
92
  };
71
- function L(e, t, r, a, o, n) {
72
- const u = f("kv-countdown-timer");
73
- return n.variation ? (i(), p("div", {
93
+ function S(e, n, i, o, r, a) {
94
+ const u = h("kv-countdown-timer");
95
+ return a.variation ? (d(), g("div", {
74
96
  key: 0,
75
97
  class: "tw-text-small tw-font-medium tw-pt-0.5 tw-line-clamp-1",
76
- style: h({ color: n.tagColor })
98
+ style: L({ color: a.tagColor })
77
99
  }, [
78
- x(g(n.tagText) + " ", 1),
79
- n.variation === "ending-soon" ? (i(), y(u, {
100
+ x(A(a.tagText) + " ", 1),
101
+ a.variation === "ending-soon" ? (d(), v(u, {
80
102
  key: 0,
81
- deadline: n.deadline
103
+ deadline: a.deadline
82
104
  }, null, 8, ["deadline"])) : l("", !0)
83
105
  ], 4)) : l("", !0);
84
106
  }
85
- const k = /* @__PURE__ */ v(_, [["render", L]]);
107
+ const B = /* @__PURE__ */ _(E, [["render", S]]);
86
108
  export {
87
- k as default
109
+ I as KV_LOAN_TAG_FRAGMENT,
110
+ B as default
88
111
  };
@@ -1,7 +1,20 @@
1
- import n from "numeral";
2
- import { openBlock as i, createElementBlock as a } from "vue";
1
+ import n from "graphql-tag";
2
+ import a from "numeral";
3
+ import { openBlock as i, createElementBlock as o } from "vue";
3
4
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const t = "direct", o = {
5
+ const t = "direct", g = n`
6
+ fragment KvLoanUse on LoanBasic {
7
+ id
8
+ anonymizationLevel
9
+ use
10
+ loanAmount
11
+ status
12
+ borrowerCount
13
+ name
14
+ distributionModel
15
+ whySpecial
16
+ }
17
+ `, l = {
5
18
  name: "KvLoanUse",
6
19
  props: {
7
20
  anonymizationLevel: {
@@ -57,17 +70,18 @@ const t = "direct", o = {
57
70
  if (this.hideLoanAmount)
58
71
  return `Help <span class="data-hj-suppress">${this.name}</span> ${this.use.charAt(0).toLowerCase() + this.use.slice(1)} ${this.whySpecialSentence}`;
59
72
  const e = this.borrowerCount > 1;
60
- return `${n(this.loanAmount).format("$0,0")} ${this.isDirect ? "to" : this.helpLanguage} ${e ? "a member of " : ""}<span class="data-hj-suppress">${this.name}</span> ${this.isDirect ? `${this.helpLanguage} ` : ""}${this.use.charAt(0).toLowerCase() + this.use.slice(1)}${this.whySpecialSentence}`;
73
+ return `${a(this.loanAmount).format("$0,0")} ${this.isDirect ? "to" : this.helpLanguage} ${e ? "a member of " : ""}<span class="data-hj-suppress">${this.name}</span> ${this.isDirect ? `${this.helpLanguage} ` : ""}${this.use.charAt(0).toLowerCase() + this.use.slice(1)}${this.whySpecialSentence}`;
61
74
  }
62
75
  }
63
- }, l = ["innerHTML"];
64
- function u(e, h, p, c, d, s) {
65
- return i(), a("p", {
76
+ }, u = ["innerHTML"];
77
+ function h(e, p, c, m, d, s) {
78
+ return i(), o("p", {
66
79
  class: "tw-line-clamp-4",
67
80
  innerHTML: s.loanUse
68
- }, null, 8, l);
81
+ }, null, 8, u);
69
82
  }
70
- const S = /* @__PURE__ */ r(o, [["render", u]]);
83
+ const w = /* @__PURE__ */ r(l, [["render", h]]);
71
84
  export {
72
- S as default
85
+ g as KV_LOAN_USE_FRAGMENT,
86
+ w as default
73
87
  };
@@ -1 +1 @@
1
- .loan-card-use[data-v-b544291f]:hover,.loan-card-use[data-v-b544291f]:focus{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1))}.loan-card-active-hover:hover .loan-card-use[data-v-b544291f]{text-decoration-line:underline}.loan-card-progress[data-v-b544291f],.loan-card-progress[data-v-b544291f]:hover,.loan-card-progress[data-v-b544291f]:focus{text-decoration-line:none}.loan-callouts[data-v-b544291f] div{height:auto;flex-wrap:wrap}
1
+ .loan-card-use[data-v-060ff1b9]:hover,.loan-card-use[data-v-060ff1b9]:focus{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1))}.loan-card-active-hover:hover .loan-card-use[data-v-060ff1b9]{text-decoration-line:underline}.loan-card-progress[data-v-060ff1b9],.loan-card-progress[data-v-060ff1b9]:hover,.loan-card-progress[data-v-060ff1b9]:focus{text-decoration-line:none}.loan-callouts[data-v-060ff1b9] div{height:auto;flex-wrap:wrap}
@@ -1,28 +1,58 @@
1
- import { loanCardComputedProperties as V, loanCardMethods as z } from "../utils/loanCard.js";
2
- import T from "./KvLoanUse.js";
3
- import F from "./KvBorrowerImage.js";
4
- import R from "./KvLoanProgressGroup.js";
5
- import I from "./KvLoanCallouts.js";
6
- import W from "./KvLendCta.js";
7
- import H from "./KvLoanBookmark.js";
8
- import U from "./KvLoanTag.js";
9
- import j from "./KvMaterialIcon.js";
10
- import q from "./KvLoadingPlaceholder.js";
11
- import { resolveComponent as r, openBlock as o, createElementBlock as s, normalizeClass as p, createElementVNode as m, createBlock as n, resolveDynamicComponent as f, withCtx as g, createVNode as d, createTextVNode as E, toDisplayString as M, createCommentVNode as u, Fragment as O, renderList as G } from "vue";
1
+ import B from "graphql-tag";
2
+ import { LOAN_CALLOUTS_FRAGMENT as S, LOAN_GEOCODE_FRAGMENT as F, LOAN_PROGRESS_FRAGMENT as V, loanCardComputedProperties as O, loanCardMethods as G } from "../utils/loanCard.js";
3
+ import U, { KV_LOAN_USE_FRAGMENT as W } from "./KvLoanUse.js";
4
+ import z from "./KvBorrowerImage.js";
5
+ import I from "./KvLoanProgressGroup.js";
6
+ import H from "./KvLoanCallouts.js";
7
+ import j, { KV_LEND_CTA_FRAGMENT as q, KV_LEND_CTA_USER_FRAGMENT as J } from "./KvLendCta.js";
8
+ import Q, { KV_LOAN_BOOKMARK_FRAGMENT as X } from "./KvLoanBookmark.js";
9
+ import Y, { KV_LOAN_TAG_FRAGMENT as Z } from "./KvLoanTag.js";
10
+ import $ from "./KvMaterialIcon.js";
11
+ import ee from "./KvLoadingPlaceholder.js";
12
+ import { resolveComponent as r, openBlock as o, createElementBlock as s, normalizeClass as N, createElementVNode as m, createBlock as l, resolveDynamicComponent as f, withCtx as g, createVNode as d, createTextVNode as te, toDisplayString as M, createCommentVNode as u, Fragment as oe, renderList as ae } from "vue";
12
13
  import "./KvWideLoanCard.css";
13
- import J from "../_virtual/_plugin-vue_export-helper.js";
14
- const Q = {
14
+ import ne from "../_virtual/_plugin-vue_export-helper.js";
15
+ const De = B`
16
+ fragment KvWideLoanCard on LoanBasic {
17
+ id
18
+ image {
19
+ id
20
+ hash # for imageHash
21
+ }
22
+ name # for borrowerName
23
+ ...KvLendCta
24
+ ...KvLoanTag
25
+ ...KvLoanUse
26
+ ...LoanCallouts
27
+ ...LoanGeocode
28
+ ...LoanProgress
29
+ }
30
+ ${q}
31
+ ${Z}
32
+ ${W}
33
+ ${S}
34
+ ${F}
35
+ ${V}
36
+ `, Te = B`
37
+ fragment KvWideLoanCardUser on LoanBasic {
38
+ id
39
+ ...KvLendCtaUser
40
+ ...KvLoanBookmark
41
+ }
42
+ ${J}
43
+ ${X}
44
+ `, le = {
15
45
  name: "KvWideLoanCard",
16
46
  components: {
17
- KvBorrowerImage: F,
18
- KvLoadingPlaceholder: q,
19
- KvLoanUse: T,
20
- KvLoanProgressGroup: R,
21
- KvMaterialIcon: j,
22
- KvLendCta: W,
23
- KvLoanTag: U,
24
- KvLoanCallouts: I,
25
- KvLoanBookmark: H
47
+ KvBorrowerImage: z,
48
+ KvLoadingPlaceholder: ee,
49
+ KvLoanUse: U,
50
+ KvLoanProgressGroup: I,
51
+ KvMaterialIcon: $,
52
+ KvLendCta: j,
53
+ KvLoanTag: Y,
54
+ KvLoanCallouts: H,
55
+ KvLoanBookmark: Q
26
56
  },
27
57
  props: {
28
58
  loanId: {
@@ -114,49 +144,51 @@ const Q = {
114
144
  const {
115
145
  allDataLoaded: t,
116
146
  borrowerName: e,
117
- city: B,
147
+ city: C,
118
148
  countryName: w,
119
149
  distributionModel: i,
120
150
  formattedLocation: k,
121
151
  fundraisingPercent: h,
122
- hasProgressData: v,
123
- imageHash: b,
124
- isLoading: y,
125
- loanAmount: _,
126
- loanBorrowerCount: x,
127
- loanCallouts: L,
128
- loanStatus: l,
129
- loanUse: C,
130
- mdiMapMarker: P,
131
- readMorePath: A,
132
- state: D,
133
- tag: S,
134
- unreservedAmount: N
135
- } = V(c), {
136
- clickReadMore: K
137
- } = z(c, a);
152
+ hasProgressData: _,
153
+ imageHash: v,
154
+ isLoading: b,
155
+ loanAmount: y,
156
+ loanBorrowerCount: L,
157
+ loanCallouts: A,
158
+ loanStatus: n,
159
+ loanUse: x,
160
+ mdiMapMarker: K,
161
+ readMorePath: P,
162
+ state: R,
163
+ tag: D,
164
+ unreservedAmount: T,
165
+ sharesAvailable: p
166
+ } = O(c), {
167
+ clickReadMore: E
168
+ } = G(c, a);
138
169
  return {
139
170
  allDataLoaded: t,
140
171
  borrowerName: e,
141
- city: B,
172
+ city: C,
142
173
  countryName: w,
143
174
  distributionModel: i,
144
175
  formattedLocation: k,
145
176
  fundraisingPercent: h,
146
- hasProgressData: v,
147
- imageHash: b,
148
- isLoading: y,
149
- loanAmount: _,
150
- loanBorrowerCount: x,
151
- loanCallouts: L,
152
- loanStatus: l,
153
- loanUse: C,
154
- mdiMapMarker: P,
155
- readMorePath: A,
156
- state: D,
157
- tag: S,
158
- unreservedAmount: N,
159
- clickReadMore: K
177
+ hasProgressData: _,
178
+ imageHash: v,
179
+ isLoading: b,
180
+ loanAmount: y,
181
+ loanBorrowerCount: L,
182
+ loanCallouts: A,
183
+ loanStatus: n,
184
+ loanUse: x,
185
+ mdiMapMarker: K,
186
+ readMorePath: P,
187
+ state: R,
188
+ tag: D,
189
+ unreservedAmount: T,
190
+ sharesAvailable: p,
191
+ clickReadMore: E
160
192
  };
161
193
  },
162
194
  computed: {
@@ -179,39 +211,39 @@ const Q = {
179
211
  ];
180
212
  }
181
213
  }
182
- }, X = { class: "loan-card-active-hover tw-flex-1 tw-min-w-[275px] md:tw-min-w-[320px] md:tw-max-w-[320px]" }, Y = {
214
+ }, re = { class: "loan-card-active-hover tw-flex-1 tw-min-w-[275px] md:tw-min-w-[320px] md:tw-max-w-[320px]" }, ie = {
183
215
  key: 1,
184
216
  class: "tw-relative tw-w-full"
185
- }, Z = { key: 0 }, $ = {
217
+ }, se = { key: 0 }, de = {
186
218
  class: "tw-absolute tw-bottom-1 tw-left-1 tw-text-primary tw-bg-white tw-rounded tw-p-1 tw-mb-0 tw-mr-2 tw-text-h4 tw-inline-flex tw-items-center",
187
219
  style: { padding: "2px 6px", "text-transform": "capitalize" }
188
- }, ee = { class: "tw-flex tw-flex-col tw-flex-1 tw-px-1" }, te = { class: "tw-hidden md:tw-inline-block" }, oe = { class: "tw-pt-1" }, ae = {
220
+ }, me = { class: "tw-flex tw-flex-col tw-flex-1 tw-px-1" }, ce = { class: "tw-hidden md:tw-inline-block" }, we = { class: "tw-pt-1" }, ue = {
189
221
  key: 0,
190
222
  class: "tw-w-full",
191
223
  style: { height: "5.5rem" }
192
- }, le = { key: 1 }, ne = { class: "tw-flex tw-flex-row tw-justify-between tw-gap-1 md:tw-gap-3" }, re = {
224
+ }, fe = { key: 1 }, ge = { class: "tw-flex tw-flex-row tw-justify-between tw-gap-1 md:tw-gap-3" }, ke = {
193
225
  key: 0,
194
226
  class: "tw-w-full tw-pt-1 tw-pr-1"
195
227
  };
196
- function ie(c, a, t, e, B, w) {
197
- const i = r("kv-loading-placeholder"), k = r("kv-borrower-image"), h = r("kv-material-icon"), v = r("kv-loan-bookmark"), b = r("kv-loan-tag"), y = r("kv-loan-use"), _ = r("kv-loan-callouts"), x = r("kv-loan-progress-group"), L = r("kv-lend-cta");
228
+ function he(c, a, t, e, C, w) {
229
+ const i = r("kv-loading-placeholder"), k = r("kv-borrower-image"), h = r("kv-material-icon"), _ = r("kv-loan-bookmark"), v = r("kv-loan-tag"), b = r("kv-loan-use"), y = r("kv-loan-callouts"), L = r("kv-loan-progress-group"), A = r("kv-lend-cta");
198
230
  return o(), s("div", {
199
- class: p(["tw-flex tw-flex-row tw-flex-wrap tw-bg-white tw-rounded tw-w-full tw-pb-1 tw-p-1 tw-gap-1 tw-items-center", { "tw-pointer-events-none": e.isLoading }]),
231
+ class: N(["tw-flex tw-flex-row tw-flex-wrap tw-bg-white tw-rounded tw-w-full tw-pb-1 tw-p-1 tw-gap-1 tw-items-center", { "tw-pointer-events-none": e.isLoading }]),
200
232
  "data-testid": "loan-card",
201
233
  style: { "box-shadow": "0 4px 12px rgba(0, 0, 0, 0.08)" }
202
234
  }, [
203
- m("div", X, [
204
- e.isLoading ? (o(), n(i, {
235
+ m("div", re, [
236
+ e.isLoading ? (o(), l(i, {
205
237
  key: 0,
206
238
  class: "tw-mb-1 tw-w-full tw-rounded",
207
239
  style: { height: "15rem" }
208
- })) : (o(), s("div", Y, [
209
- (o(), n(f(e.tag), {
240
+ })) : (o(), s("div", ie, [
241
+ (o(), l(f(e.tag), {
210
242
  to: e.readMorePath,
211
243
  href: e.readMorePath,
212
244
  class: "tw-flex",
213
245
  "aria-label": "Borrower image",
214
- onClick: a[0] || (a[0] = (l) => e.clickReadMore("Photo", l))
246
+ onClick: a[0] || (a[0] = (n) => e.clickReadMore("Photo", n))
215
247
  }, {
216
248
  default: g(() => [
217
249
  d(k, {
@@ -223,64 +255,64 @@ function ie(c, a, t, e, B, w) {
223
255
  images: w.imageSizes,
224
256
  "photo-path": t.photoPath
225
257
  }, null, 8, ["alt", "aspect-ratio", "default-image", "hash", "images", "photo-path"]),
226
- e.countryName ? (o(), s("div", Z, [
227
- m("p", $, [
258
+ e.countryName ? (o(), s("div", se, [
259
+ m("p", de, [
228
260
  d(h, {
229
261
  class: "tw-h-2 tw-w-2",
230
262
  icon: e.mdiMapMarker
231
263
  }, null, 8, ["icon"]),
232
- E(" " + M(e.formattedLocation), 1)
264
+ te(" " + M(e.formattedLocation), 1)
233
265
  ])
234
266
  ])) : u("", !0)
235
267
  ]),
236
268
  _: 1
237
269
  }, 8, ["to", "href"])),
238
- t.isVisitor ? u("", !0) : (o(), n(v, {
270
+ t.isVisitor ? u("", !0) : (o(), l(_, {
239
271
  key: 0,
240
272
  "loan-id": t.loanId,
241
273
  "is-bookmarked": t.isBookmarked,
242
274
  class: "tw-absolute tw-right-1",
243
275
  style: { top: "-6px" },
244
276
  "data-testid": "loan-card-bookmark",
245
- onToggleBookmark: a[1] || (a[1] = (l) => c.$emit("toggle-bookmark"))
277
+ onToggleBookmark: a[1] || (a[1] = (n) => c.$emit("toggle-bookmark"))
246
278
  }, null, 8, ["loan-id", "is-bookmarked"]))
247
279
  ]))
248
280
  ]),
249
- m("div", ee, [
250
- m("h3", te, M(e.borrowerName), 1),
251
- (o(), n(f(e.tag), {
281
+ m("div", me, [
282
+ m("h3", ce, M(e.borrowerName), 1),
283
+ (o(), l(f(e.tag), {
252
284
  to: e.readMorePath,
253
285
  href: e.readMorePath,
254
286
  class: "tw-flex tw-no-underline hover:tw-no-underline focus:tw-no-underline",
255
287
  "aria-label": "Loan tag",
256
- onClick: a[2] || (a[2] = (l) => e.clickReadMore("Tag", l))
288
+ onClick: a[2] || (a[2] = (n) => e.clickReadMore("Tag", n))
257
289
  }, {
258
290
  default: g(() => [
259
- t.showTags && !e.isLoading ? (o(), n(b, {
291
+ t.showTags && !e.isLoading ? (o(), l(v, {
260
292
  key: 0,
261
293
  loan: t.loan
262
294
  }, null, 8, ["loan"])) : u("", !0)
263
295
  ]),
264
296
  _: 1
265
297
  }, 8, ["to", "href"])),
266
- (o(), n(f(e.tag), {
298
+ (o(), l(f(e.tag), {
267
299
  to: e.readMorePath,
268
300
  href: e.readMorePath,
269
301
  class: "loan-card-use tw-no-underline tw-text-primary",
270
302
  "aria-label": "Loan use",
271
- onClick: a[3] || (a[3] = (l) => e.clickReadMore("Use"))
303
+ onClick: a[3] || (a[3] = (n) => e.clickReadMore("Use"))
272
304
  }, {
273
305
  default: g(() => [
274
- m("div", oe, [
275
- e.isLoading ? (o(), s("div", ae, [
276
- (o(!0), s(O, null, G([...Array(4)], (l, C) => (o(), s("div", {
277
- key: C,
306
+ m("div", we, [
307
+ e.isLoading ? (o(), s("div", ue, [
308
+ (o(!0), s(oe, null, ae([...Array(4)], (n, x) => (o(), s("div", {
309
+ key: x,
278
310
  class: "tw-h-2 tw-mb-1"
279
311
  }, [
280
312
  d(i)
281
313
  ]))), 128))
282
- ])) : (o(), s("div", le, [
283
- d(y, {
314
+ ])) : (o(), s("div", fe, [
315
+ d(b, {
284
316
  use: e.loanUse,
285
317
  "loan-amount": e.loanAmount,
286
318
  status: e.loanStatus,
@@ -293,17 +325,17 @@ function ie(c, a, t, e, B, w) {
293
325
  ]),
294
326
  _: 1
295
327
  }, 8, ["to", "href"])),
296
- e.isLoading || typeof e.loanCallouts > "u" ? (o(), n(i, {
328
+ e.isLoading || typeof e.loanCallouts > "u" ? (o(), l(i, {
297
329
  key: 0,
298
330
  class: "tw-mt-1.5 tw-mb-1",
299
331
  style: { width: "60%", height: "1.75rem", "border-radius": "500rem" }
300
- })) : (o(), n(_, {
332
+ })) : (o(), l(y, {
301
333
  key: 1,
302
334
  callouts: e.loanCallouts,
303
335
  class: "loan-callouts tw-my-1.5"
304
336
  }, null, 8, ["callouts"])),
305
- m("div", ne, [
306
- e.hasProgressData ? u("", !0) : (o(), s("div", re, [
337
+ m("div", ge, [
338
+ e.hasProgressData ? u("", !0) : (o(), s("div", ke, [
307
339
  d(i, {
308
340
  class: "tw-mb-0.5",
309
341
  style: { width: "70%", height: "1.3rem" }
@@ -313,27 +345,28 @@ function ie(c, a, t, e, B, w) {
313
345
  style: { width: "70%", height: "0.5rem" }
314
346
  })
315
347
  ])),
316
- e.unreservedAmount > 0 ? (o(), n(f(e.tag), {
348
+ e.sharesAvailable ? (o(), l(f(e.tag), {
317
349
  key: 1,
318
350
  to: e.readMorePath,
319
351
  href: e.readMorePath,
320
352
  class: "loan-card-progress tw-mt-1 tw-flex-grow",
321
353
  "aria-label": "Loan progress",
322
- onClick: a[4] || (a[4] = (l) => e.clickReadMore("Progress", l))
354
+ onClick: a[4] || (a[4] = (n) => e.clickReadMore("Progress", n))
323
355
  }, {
324
356
  default: g(() => [
325
- d(x, {
357
+ d(L, {
326
358
  id: "loanProgress",
327
- "money-left": `${e.unreservedAmount}`,
359
+ "money-left": e.unreservedAmount,
328
360
  "progress-percent": e.fundraisingPercent,
329
361
  class: "tw-text-black"
330
362
  }, null, 8, ["money-left", "progress-percent"])
331
363
  ]),
332
364
  _: 1
333
365
  }, 8, ["to", "href"])) : u("", !0),
334
- e.allDataLoaded ? (o(), n(L, {
366
+ e.allDataLoaded ? (o(), l(A, {
335
367
  key: 3,
336
368
  loan: t.loan,
369
+ "unreserved-amount": e.unreservedAmount,
337
370
  "basket-items": t.basketItems,
338
371
  "is-loading": e.isLoading,
339
372
  "is-adding": t.isAdding,
@@ -349,10 +382,10 @@ function ie(c, a, t, e, B, w) {
349
382
  "set-cookie": t.setCookie,
350
383
  "enable-huge-amount": t.enableHugeAmount,
351
384
  "is-visitor": t.isVisitor,
352
- class: p(["tw-mt-auto tw-self-end", { "tw-flex-grow": e.unreservedAmount === 0, "tw-flex-shrink-0": e.unreservedAmount > 0 }]),
353
- onAddToBasket: a[5] || (a[5] = (l) => c.$emit("add-to-basket", l)),
354
- onShowLoanDetails: a[6] || (a[6] = (l) => e.clickReadMore("ViewLoan", l))
355
- }, null, 8, ["loan", "basket-items", "is-loading", "is-adding", "enable-five-dollars-notes", "five-dollars-selected", "kv-track-function", "show-view-loan", "custom-loan-details", "external-links", "route", "user-balance", "get-cookie", "set-cookie", "enable-huge-amount", "is-visitor", "class"])) : (o(), n(i, {
385
+ class: N(["tw-mt-auto tw-self-end", { "tw-flex-grow": !e.sharesAvailable, "tw-flex-shrink-0": e.sharesAvailable }]),
386
+ onAddToBasket: a[5] || (a[5] = (n) => c.$emit("add-to-basket", n)),
387
+ onShowLoanDetails: a[6] || (a[6] = (n) => e.clickReadMore("ViewLoan", n))
388
+ }, null, 8, ["loan", "unreserved-amount", "basket-items", "is-loading", "is-adding", "enable-five-dollars-notes", "five-dollars-selected", "kv-track-function", "show-view-loan", "custom-loan-details", "external-links", "route", "user-balance", "get-cookie", "set-cookie", "enable-huge-amount", "is-visitor", "class"])) : (o(), l(i, {
356
389
  key: 2,
357
390
  class: "tw-rounded tw-self-start",
358
391
  style: { width: "9rem", height: "3rem" }
@@ -361,7 +394,9 @@ function ie(c, a, t, e, B, w) {
361
394
  ])
362
395
  ], 2);
363
396
  }
364
- const _e = /* @__PURE__ */ J(Q, [["render", ie], ["__scopeId", "data-v-b544291f"]]);
397
+ const pe = /* @__PURE__ */ ne(le, [["render", he], ["__scopeId", "data-v-060ff1b9"]]);
365
398
  export {
366
- _e as default
399
+ De as KV_WIDE_LOAN_CARD_FRAGMENT,
400
+ Te as KV_WIDE_LOAN_CARD_USER_FRAGMENT,
401
+ pe as default
367
402
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.13.2",
3
+ "version": "6.14.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -62,6 +62,7 @@
62
62
  "eslint-plugin-vue": "^7.9.0",
63
63
  "flag-icons": "^7.3.0",
64
64
  "focus-trap": "^6.9.4",
65
+ "graphql-tag": "^2.12.6",
65
66
  "import-meta-loader": "^1.1.0",
66
67
  "jest": "^27.4.3",
67
68
  "jest-axe": "^5.0.1",
@@ -98,6 +99,7 @@
98
99
  "change-case": "^5.4.4",
99
100
  "date-fns": "2.x",
100
101
  "focus-trap": "6.x",
102
+ "graphql-tag": "2.x",
101
103
  "nanoid": "3.x",
102
104
  "numeral": "2.x",
103
105
  "vue": "3.x"
@@ -109,5 +111,5 @@
109
111
  "embla-carousel-fade",
110
112
  "popper.js"
111
113
  ],
112
- "gitHead": "1ab667d2555ca1cb60b1b37508878563857a6bd1"
114
+ "gitHead": "247947ae36f1ad2aab67f2e6bac62805ebbe7129"
113
115
  }