@kiva/kv-components 6.69.3 → 7.0.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,5 +1,5 @@
1
1
  import r from "./KvUserAvatar.js";
2
- import { resolveComponent as o, openBlock as i, createElementBlock as a, createElementVNode as t, createVNode as c } from "vue";
2
+ import { resolveComponent as o, openBlock as a, createElementBlock as i, createElementVNode as t, createVNode as c } from "vue";
3
3
  import l from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const s = {
5
5
  name: "KvActivityRow",
@@ -13,14 +13,15 @@ const s = {
13
13
  }
14
14
  }
15
15
  }, m = { class: "tw-flex tw-gap-x-1 tw-items-center" }, d = ["innerHTML"];
16
- function v(_, u, e, p, f, y) {
16
+ function v(_, p, e, u, f, w) {
17
17
  const n = o("KvUserAvatar");
18
- return i(), a("div", m, [
18
+ return a(), i("div", m, [
19
19
  t("div", null, [
20
20
  c(n, {
21
21
  "lender-name": e.activity.lenderName,
22
22
  "lender-image-url": e.activity.lenderImage,
23
- "is-small": !0
23
+ class: "tw-w-3 tw-h-3",
24
+ "is-small": ""
24
25
  }, null, 8, ["lender-name", "lender-image-url"])
25
26
  ]),
26
27
  t("div", null, [
@@ -1 +1 @@
1
- [data-v-0f318c7e] input{height:2rem;border-radius:0;border-top-width:0px;border-right-width:0px;border-left-width:0px;padding:0}[data-v-0f318c7e] input:focus{--tw-border-opacity: 1;border-color:rgba(var(--border-tertiary),var(--tw-border-opacity, 1));box-shadow:none}[data-v-0f318c7e] button>span{min-height:0}[data-v-0f318c7e] button>span>span{padding-top:0;padding-bottom:0;padding-left:.25rem;padding-right:.25rem}
1
+ [data-v-8a6d6ddc] input{height:2rem;border-radius:0;border-top-width:0px;border-right-width:0px;border-left-width:0px;padding:0}[data-v-8a6d6ddc] input:focus{--tw-border-opacity: 1;border-color:rgba(var(--border-tertiary),var(--tw-border-opacity, 1));box-shadow:none}[data-v-8a6d6ddc] button>span{min-height:0}[data-v-8a6d6ddc] button>span>span{padding-top:0;padding-bottom:0;padding-left:.25rem;padding-right:.25rem}
@@ -36,11 +36,11 @@ const h = "add-comment-value", f = "add-comment", m = "hide-input", I = {
36
36
  },
37
37
  emits: [f, m],
38
38
  setup(l, { emit: t }) {
39
- const e = u(""), o = u(null), c = C(() => e.value ? "" : "disabled");
39
+ const e = u(""), o = u(null), d = C(() => e.value ? "" : "disabled");
40
40
  return {
41
41
  ADD_COMMENT_ID: h,
42
42
  addCommentValue: e,
43
- commentButtonState: c,
43
+ commentButtonState: d,
44
44
  cancel: () => {
45
45
  e.value = "", l.isReply && t(m);
46
46
  },
@@ -51,14 +51,15 @@ const h = "add-comment-value", f = "add-comment", m = "hide-input", I = {
51
51
  };
52
52
  }
53
53
  }, K = { class: "tw-flex tw-flex-col" }, T = { class: "tw-flex tw-flex-col md:tw-flex-row md:tw-items-center tw-gap-0.5 md:tw-gap-1" }, A = { class: "tw-flex tw-items-center tw-gap-1" }, B = { class: "data-hj-suppress tw-font-medium" }, M = { class: "tw-flex tw-py-0.5 tw-gap-0.5" };
54
- function S(l, t, e, o, c, v) {
55
- const d = s("kv-user-avatar"), r = s("kv-text-input"), i = s("kv-button");
54
+ function S(l, t, e, o, d, v) {
55
+ const c = s("kv-user-avatar"), r = s("kv-text-input"), i = s("kv-button");
56
56
  return x(), g("div", K, [
57
57
  n("div", T, [
58
58
  n("div", A, [
59
- a(d, {
59
+ a(c, {
60
60
  "lender-name": e.userDisplayName,
61
61
  "lender-image-url": e.userImageUrl,
62
+ class: "tw-w-3 tw-h-3",
62
63
  "is-small": ""
63
64
  }, null, 8, ["lender-name", "lender-image-url"]),
64
65
  n("div", B, y(e.userDisplayName), 1)
@@ -97,7 +98,7 @@ function S(l, t, e, o, c, v) {
97
98
  ])
98
99
  ]);
99
100
  }
100
- const P = /* @__PURE__ */ E(I, [["render", S], ["__scopeId", "data-v-0f318c7e"]]);
101
+ const P = /* @__PURE__ */ E(I, [["render", S], ["__scopeId", "data-v-8a6d6ddc"]]);
101
102
  export {
102
103
  f as ADD_COMMENT_EVENT,
103
104
  h as ADD_COMMENT_ID,
@@ -55,11 +55,11 @@ const $ = "reply-comment", ee = "like-comment", N = "add-reaction", te = {
55
55
  emits: [
56
56
  N
57
57
  ],
58
- setup(g, { emit: s }) {
58
+ setup(h, { emit: s }) {
59
59
  const {
60
60
  comment: e,
61
61
  userPublicId: n
62
- } = B(g), u = y(!1), h = y(null), a = y(), _ = y(!1), b = i(() => {
62
+ } = B(h), u = y(!1), g = y(null), a = y(), _ = y(!1), b = i(() => {
63
63
  var t;
64
64
  return ((t = e == null ? void 0 : e.value) == null ? void 0 : t.text) ?? "";
65
65
  }), w = i(() => {
@@ -79,7 +79,7 @@ const $ = "reply-comment", ee = "like-comment", N = "add-reaction", te = {
79
79
  return ((l = (t = e == null ? void 0 : e.value) == null ? void 0 : t.children) == null ? void 0 : l.like) ?? [];
80
80
  }), R = i(() => E.value.find((t) => t.publicLenderId === n.value)), O = i(() => R.value !== void 0), T = () => {
81
81
  u.value = !u.value, q(() => {
82
- u.value && h.value.$refs.input.focus();
82
+ u.value && g.value.$refs.input.focus();
83
83
  });
84
84
  }, x = (t, l) => {
85
85
  var L;
@@ -109,7 +109,7 @@ const $ = "reply-comment", ee = "like-comment", N = "add-reaction", te = {
109
109
  }), {
110
110
  hideInput: D,
111
111
  showInput: u,
112
- commentsAddRef: h,
112
+ commentsAddRef: g,
113
113
  replyClick: T,
114
114
  addReaction: x,
115
115
  REPLY_COMMENT_EVENT: $,
@@ -141,7 +141,7 @@ const $ = "reply-comment", ee = "like-comment", N = "add-reaction", te = {
141
141
  key: 1,
142
142
  class: "tw-my-1"
143
143
  }, me = { key: 1 };
144
- function de(g, s, e, n, u, h) {
144
+ function de(h, s, e, n, u, g) {
145
145
  const a = v("kv-user-avatar"), _ = v("kv-comments-heart-button"), b = v("kv-comments-reply-button"), w = v("kv-comments-add"), C = v("kv-material-icon"), I = v("kv-comments-list-item", !0);
146
146
  return r(), m("div", null, [
147
147
  f("div", null, [
@@ -149,6 +149,7 @@ function de(g, s, e, n, u, h) {
149
149
  k(a, {
150
150
  "lender-name": n.authorName,
151
151
  "lender-image-url": n.authorImage,
152
+ class: "tw-w-3 tw-h-3",
152
153
  "is-small": ""
153
154
  }, null, 8, ["lender-name", "lender-image-url"]),
154
155
  n.authorName ? (r(), m("p", le, p(n.authorName), 1)) : c("", !0)
@@ -205,7 +206,7 @@ function de(g, s, e, n, u, h) {
205
206
  comment: o,
206
207
  "nest-level": e.nestLevel + 1,
207
208
  onAddReaction: s[3] || (s[3] = (E) => {
208
- g.$emit(n.ADD_REACTION_EVENT, E);
209
+ h.$emit(n.ADD_REACTION_EVENT, E);
209
210
  })
210
211
  }, null, 8, ["user-image-url", "user-display-name", "user-public-id", "comment", "nest-level"])
211
212
  ]))), 128))
@@ -1,4 +1,4 @@
1
- import { openBlock as n, createElementBlock as s, createElementVNode as t, toDisplayString as l } from "vue";
1
+ import { openBlock as n, createElementBlock as s, createElementVNode as e, toDisplayString as c, createCommentVNode as l } from "vue";
2
2
  import r from "../_virtual/_plugin-vue_export-helper.js";
3
3
  const i = {
4
4
  props: {
@@ -7,35 +7,38 @@ const i = {
7
7
  default: 0
8
8
  }
9
9
  }
10
- }, f = {
10
+ }, u = {
11
11
  xmlns: "http://www.w3.org/2000/svg",
12
12
  viewBox: "0 0 24 24"
13
- }, c = { id: "countMask" }, d = {
13
+ }, d = ["id"], a = {
14
14
  x: "12",
15
15
  y: "17",
16
16
  fill: "#000",
17
17
  style: { "font-size": "9px", "font-weight": "631", "text-anchor": "middle" }
18
- };
19
- function u(p, o, e, a, m, _) {
20
- return n(), s("svg", f, [
21
- t("defs", null, [
22
- t("mask", c, [
23
- o[0] || (o[0] = t("rect", {
18
+ }, f = ["mask"];
19
+ function m(_, o, t, h, x, k) {
20
+ return n(), s("svg", u, [
21
+ e("defs", null, [
22
+ t.count > 0 ? (n(), s("mask", {
23
+ key: 0,
24
+ id: `countMask-${t.count}`
25
+ }, [
26
+ o[0] || (o[0] = e("rect", {
24
27
  width: "100%",
25
28
  height: "100%",
26
29
  fill: "#fff"
27
30
  }, null, -1)),
28
- t("text", d, l(e.count), 1)
29
- ])
31
+ e("text", a, c(t.count), 1)
32
+ ], 8, d)) : l("", !0)
30
33
  ]),
31
- o[1] || (o[1] = t("path", {
34
+ e("path", {
32
35
  d: "M12,3A3,3 0 0,1 15,6H9A3,3 0 0,1 12,3M19,6H17A5,5 0 0,0 12,1A5,5 0 0,0 7,6H5C3.89,6 3,6.89 3,8V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V8C21,6.89 20.1,6 19,6Z",
33
36
  fill: "currentColor",
34
- mask: "url(#countMask)"
35
- }, null, -1))
37
+ mask: `url(#countMask-${t.count})`
38
+ }, null, 8, f)
36
39
  ]);
37
40
  }
38
- const h = /* @__PURE__ */ r(i, [["render", u]]);
41
+ const w = /* @__PURE__ */ r(i, [["render", m]]);
39
42
  export {
40
- h as default
43
+ w as default
41
44
  };
@@ -1,11 +1,10 @@
1
- import { toRefs as c, computed as l, resolveComponent as m, openBlock as p, createElementBlock as i, createVNode as _, createElementVNode as d, toDisplayString as v, createTextVNode as u } from "vue";
2
- import w from "./KvUserAvatar.js";
3
- import "./KvInlineActivityCard.css";
4
- import f from "../_virtual/_plugin-vue_export-helper.js";
1
+ import { toRefs as c, computed as l, resolveComponent as m, openBlock as p, createElementBlock as i, createVNode as w, createElementVNode as d, toDisplayString as u, createTextVNode as _ } from "vue";
2
+ import f from "./KvUserAvatar.js";
3
+ import v from "../_virtual/_plugin-vue_export-helper.js";
5
4
  const g = {
6
5
  name: "KvInlineActivityCard",
7
6
  components: {
8
- KvUserAvatar: w
7
+ KvUserAvatar: f
9
8
  },
10
9
  props: {
11
10
  /**
@@ -16,38 +15,38 @@ const g = {
16
15
  default: () => ({})
17
16
  }
18
17
  },
19
- setup(o) {
18
+ setup(s) {
20
19
  const {
21
20
  activity: e
22
- } = c(o), s = l(() => {
21
+ } = c(s), a = l(() => {
23
22
  var t, r;
24
23
  return ((r = (t = e == null ? void 0 : e.value) == null ? void 0 : t.lender) == null ? void 0 : r.name) ?? "";
25
24
  });
26
25
  return {
27
26
  lenderImageUrl: l(() => {
28
- var t, r, a;
29
- return ((a = (r = (t = e == null ? void 0 : e.value) == null ? void 0 : t.lender) == null ? void 0 : r.image) == null ? void 0 : a.url) ?? "";
27
+ var t, r, o;
28
+ return ((o = (r = (t = e == null ? void 0 : e.value) == null ? void 0 : t.lender) == null ? void 0 : r.image) == null ? void 0 : o.url) ?? "";
30
29
  }),
31
- lenderName: s
30
+ lenderName: a
32
31
  };
33
32
  }
34
- }, x = { class: "tw-flex tw-items-center tw-gap-1 tw-py-0.5 tw-px-1 tw-shadow-lg tw-rounded-xs tw-bg-white" }, h = { class: "tw-text-base tw-whitespace-nowrap" }, I = { class: "data-hj-suppress" };
35
- function N(o, e, s, n, t, r) {
36
- const a = m("KvUserAvatar");
33
+ }, x = { class: "tw-flex tw-items-center tw-gap-1 tw-py-0.5 tw-px-1 tw-shadow-lg tw-rounded-xs tw-bg-white" }, h = { class: "tw-text-base tw-whitespace-nowrap" }, N = { class: "data-hj-suppress" };
34
+ function U(s, e, a, n, t, r) {
35
+ const o = m("KvUserAvatar");
37
36
  return p(), i("div", x, [
38
- _(a, {
37
+ w(o, {
39
38
  "lender-image-url": n.lenderImageUrl,
40
39
  "lender-name": n.lenderName,
41
- "is-small": "",
42
- class: "activity-avatar"
40
+ class: "tw-w-4 tw-h-4 tw-flex-shrink-0",
41
+ "is-small": ""
43
42
  }, null, 8, ["lender-image-url", "lender-name"]),
44
43
  d("p", h, [
45
- d("span", I, v(n.lenderName), 1),
46
- e[0] || (e[0] = u(" contributed "))
44
+ d("span", N, u(n.lenderName), 1),
45
+ e[0] || (e[0] = _(" contributed "))
47
46
  ])
48
47
  ]);
49
48
  }
50
- const y = /* @__PURE__ */ f(g, [["render", N], ["__scopeId", "data-v-84a9404c"]]);
49
+ const b = /* @__PURE__ */ v(g, [["render", U]]);
51
50
  export {
52
- y as default
51
+ b as default
53
52
  };
@@ -1,12 +1,11 @@
1
- import { toRefs as F, ref as d, computed as u, onMounted as p, resolveComponent as U, openBlock as n, createElementBlock as o, normalizeClass as r, createElementVNode as s, createBlock as H, normalizeStyle as I, createCommentVNode as y, withDirectives as b, vShow as B, toDisplayString as P } from "vue";
2
- import { isLegacyPlaceholderAvatar as j, randomizedUserAvatarClass as D } from "../utils/imageUtils.js";
3
- import M from "./KvLoadingPlaceholder.js";
4
- import "./KvUserAvatar.css";
5
- import N from "../_virtual/_plugin-vue_export-helper.js";
6
- const V = {
1
+ import { toRefs as B, ref as m, computed as a, onMounted as P, resolveComponent as V, openBlock as i, createElementBlock as c, normalizeClass as b, createElementVNode as r, createCommentVNode as f, withDirectives as N, createVNode as z, vShow as D, normalizeStyle as y, toDisplayString as F } from "vue";
2
+ import { randomizedUserAvatarClass as M, isLegacyPlaceholderAvatar as p } from "../utils/imageUtils.js";
3
+ import S from "./KvLoadingPlaceholder.js";
4
+ import E from "../_virtual/_plugin-vue_export-helper.js";
5
+ const K = {
7
6
  name: "KvUserAvatar",
8
7
  components: {
9
- KvLoadingPlaceholder: M
8
+ KvLoadingPlaceholder: S
10
9
  },
11
10
  props: {
12
11
  /**
@@ -24,115 +23,131 @@ const V = {
24
23
  default: ""
25
24
  },
26
25
  /**
27
- * The image of the lender
26
+ * Whether to render a smaller avatar
28
27
  */
29
28
  isSmall: {
30
29
  type: Boolean,
31
30
  default: !1
31
+ },
32
+ /**
33
+ * Whether to use a css variable for the avatar url before data is loaded
34
+ */
35
+ showCssPlaceholder: {
36
+ type: Boolean,
37
+ default: !1
32
38
  }
33
39
  },
34
- setup(f) {
40
+ setup(w) {
35
41
  const {
36
- lenderName: a,
37
- lenderImageUrl: e,
38
- isSmall: t
39
- } = F(f), i = d(!0), c = d(null), m = d(null), v = u(() => a.value === "" && e.value === "" || a.value === "Anonymous"), S = () => {
40
- const l = t != null && t.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
41
- return `${D(a.value)} ${l}`;
42
- }, _ = u(() => {
43
- var l;
44
- return ((l = e == null ? void 0 : e.value) == null ? void 0 : l.split("/").pop()) ?? "";
45
- }), C = u(() => {
46
- var l;
47
- return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
42
+ lenderName: t,
43
+ lenderImageUrl: s,
44
+ isSmall: e,
45
+ showCssPlaceholder: d
46
+ } = B(w), u = m(!0), l = m(null), v = m(null), C = a(() => !d.value && t.value === "" && s.value === "" || t.value === "Anonymous"), _ = a(() => {
47
+ const o = e != null && e.value ? "tw-font-sans tw-font-normal" : "tw-font-serif";
48
+ return `${M(t.value)} ${o}`;
49
+ }), A = a(() => e != null && e.value ? "0 0 27 27" : "0 0 27.5 27.5"), x = a(() => {
50
+ var n;
51
+ if (d.value)
52
+ return !0;
53
+ const o = ((n = s == null ? void 0 : s.value) == null ? void 0 : n.split("/").pop()) ?? "";
54
+ return o && !p(o);
55
+ }), I = a(() => {
56
+ var o;
57
+ return (o = t == null ? void 0 : t.value) == null ? void 0 : o.substring(0, 1).toUpperCase();
48
58
  }), g = () => {
49
- i.value = !1;
50
- }, L = (l, w = 1e4) => new Promise((k, x) => {
51
- const A = Date.now() + w, h = () => {
52
- !l || l.complete ? k(l) : Date.now() > A ? x(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
59
+ u.value = !1;
60
+ }, U = (o, n = 1e4) => new Promise((k, H) => {
61
+ const L = Date.now() + n, h = () => {
62
+ !o || o.complete ? k(o) : Date.now() > L ? H(new Error(`Timeout: ${o.src}`)) : setTimeout(h, 50);
53
63
  };
54
64
  h();
55
65
  });
56
- return p(async () => {
57
- const l = c.value;
66
+ return P(async () => {
67
+ const o = l.value;
58
68
  try {
59
- await L(l), g();
60
- } catch (w) {
61
- console.log(w.message);
69
+ await U(o), g();
70
+ } catch (n) {
71
+ console.log(n.message);
62
72
  }
63
73
  }), {
64
- isAnonymousUser: v,
65
- avatarClass: S,
66
- imageFilename: _,
67
- lenderNameFirstLetter: C,
68
- isLegacyPlaceholderAvatar: j,
69
- isLoading: i,
74
+ isAnonymousUser: C,
75
+ avatarClass: _,
76
+ userHasImage: x,
77
+ lenderNameFirstLetter: I,
78
+ letterViewBox: A,
79
+ isLegacyPlaceholderAvatar: p,
80
+ isImageLoading: u,
70
81
  onImgLoad: g,
71
- imageRef: c,
72
- userAvatar: m
82
+ imageRef: l,
83
+ userAvatar: v
73
84
  };
74
85
  }
75
- }, z = { key: 1 }, E = ["src"];
76
- function K(f, a, e, t, i, c) {
77
- const m = U("kv-loading-placeholder");
78
- return n(), o("div", {
86
+ }, R = {
87
+ key: 0,
88
+ class: "tw-h-3/4",
89
+ viewBox: "0 0 25 37",
90
+ fill: "none",
91
+ xmlns: "http://www.w3.org/2000/svg"
92
+ }, T = ["src"], Z = ["viewBox"], j = {
93
+ x: "50%",
94
+ y: "55%",
95
+ "dominant-baseline": "middle",
96
+ "text-anchor": "middle"
97
+ };
98
+ function q(w, t, s, e, d, u) {
99
+ const l = V("kv-loading-placeholder");
100
+ return i(), c("div", {
79
101
  ref: "userAvatar",
80
- class: r(["data-hj-suppress tw-flex", { "tw-w-3": e.isSmall, "tw-w-6": !e.isSmall }])
102
+ class: b(["data-hj-suppress tw-flex tw-items-center tw-justify-center tw-rounded-full tw-overflow-hidden", {
103
+ "tw-bg-brand": e.isAnonymousUser,
104
+ [e.avatarClass]: !e.isAnonymousUser
105
+ }])
81
106
  }, [
82
- t.isAnonymousUser ? (n(), o("div", {
83
- key: 0,
84
- class: r(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3": e.isSmall, "tw-w-6 tw-h-6": !e.isSmall }])
107
+ e.isAnonymousUser ? (i(), c("svg", R, t[1] || (t[1] = [
108
+ r("path", {
109
+ d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
110
+ fill: "white"
111
+ }, null, -1),
112
+ r("path", {
113
+ d: "M10.1143 23.2751C21.9428 23.2751 24.6857 13.2126 24.6857 11.4626H23.6571C11.8286 11.4626 9.08569 21.5251 9.08569 23.2751H10.1143Z",
114
+ fill: "white"
115
+ }, null, -1),
116
+ r("path", {
117
+ d: "M9.08569 24.2376C9.08569 26.0751 11.1428 36.3126 23.8285 36.3126H24.8571C24.8571 34.4751 22.8 24.2376 10.1143 24.2376H9.08569Z",
118
+ fill: "white"
119
+ }, null, -1)
120
+ ]))) : f("", !0),
121
+ N(z(l, null, null, 512), [
122
+ [D, !e.isAnonymousUser && e.userHasImage && e.isImageLoading]
123
+ ]),
124
+ !e.isAnonymousUser && e.userHasImage ? (i(), c("div", {
125
+ key: 1,
126
+ class: "tw-w-full tw-h-full",
127
+ style: y(s.showCssPlaceholder ? { display: "var(--user-avatar-display, block)" } : {
128
+ display: e.isImageLoading ? "none" : "block"
129
+ })
85
130
  }, [
86
- (n(), o("svg", {
87
- class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": e.isSmall }]),
88
- width: "25",
89
- height: "37",
90
- viewBox: "0 0 25 37",
91
- fill: "none",
92
- xmlns: "http://www.w3.org/2000/svg"
93
- }, a[1] || (a[1] = [
94
- s("path", {
95
- d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
96
- fill: "white"
97
- }, null, -1),
98
- s("path", {
99
- d: "M10.1143 23.2751C21.9428 23.2751 24.6857 13.2126 24.6857 11.4626H23.6571C11.8286 11.4626 9.08569 21.5251 9.08569 23.2751H10.1143Z",
100
- fill: "white"
101
- }, null, -1),
102
- s("path", {
103
- d: "M9.08569 24.2376C9.08569 26.0751 11.1428 36.3126 23.8285 36.3126H24.8571C24.8571 34.4751 22.8 24.2376 10.1143 24.2376H9.08569Z",
104
- fill: "white"
105
- }, null, -1)
106
- ]), 2))
107
- ], 2)) : !t.isLegacyPlaceholderAvatar(t.imageFilename) && t.imageFilename ? (n(), o("div", z, [
108
- t.isLoading ? (n(), H(m, {
109
- key: 0,
110
- style: I({
111
- width: e.isSmall ? "1.5rem" : "3rem",
112
- height: e.isSmall ? "1.5rem" : "3rem"
113
- }),
114
- class: "!tw-rounded-full"
115
- }, null, 8, ["style"])) : y("", !0),
116
- b(s("img", {
131
+ r("img", {
117
132
  ref: "imageRef",
118
- src: e.lenderImageUrl,
133
+ src: s.lenderImageUrl,
119
134
  alt: "Image of lender",
120
- class: r(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": e.isSmall, "tw-w-6 tw-h-6": !e.isSmall }]),
121
- onLoad: a[0] || (a[0] = (v) => t.onImgLoad())
122
- }, null, 42, E), [
123
- [B, !t.isLoading]
124
- ])
125
- ])) : t.isLegacyPlaceholderAvatar(t.imageFilename) || !t.imageFilename ? (n(), o("div", {
135
+ class: "tw-w-full",
136
+ style: y(s.showCssPlaceholder ? { content: "var(--user-avatar)" } : {}),
137
+ onLoad: t[0] || (t[0] = (v) => e.onImgLoad())
138
+ }, null, 44, T)
139
+ ], 4)) : f("", !0),
140
+ !e.isAnonymousUser && !e.userHasImage ? (i(), c("svg", {
126
141
  key: 2,
127
- class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", t.avatarClass()])
142
+ class: "tw-w-full tw-h-full",
143
+ fill: "currentColor",
144
+ viewBox: e.letterViewBox
128
145
  }, [
129
- s("span", {
130
- class: r(["tw-self-center", { "adjust-vertical-spacing": !e.isSmall }])
131
- }, P(t.lenderNameFirstLetter), 3)
132
- ], 2)) : y("", !0)
146
+ r("text", j, F(e.lenderNameFirstLetter), 1)
147
+ ], 8, Z)) : f("", !0)
133
148
  ], 2);
134
149
  }
135
- const J = /* @__PURE__ */ N(V, [["render", K], ["__scopeId", "data-v-c9339e78"]]);
150
+ const W = /* @__PURE__ */ E(K, [["render", q]]);
136
151
  export {
137
- J as default
152
+ W as default
138
153
  };
@@ -1 +1 @@
1
- .header-link[data-v-d30fd983]{cursor:pointer;padding-top:1rem;padding-bottom:1rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-d30fd983]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}[data-v-d30fd983] .avatar div:first-child{display:flex}
1
+ .header-link[data-v-c31f1fca]{cursor:pointer;padding-top:1rem;padding-bottom:1rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-c31f1fca]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
@@ -1,21 +1,23 @@
1
- import { defineAsyncComponent as h, ref as l, inject as Z, computed as L, watch as P, onMounted as $, onUnmounted as ee, resolveComponent as p, resolveDirective as ne, openBlock as i, createElementBlock as M, withDirectives as c, normalizeClass as A, withModifiers as B, createVNode as E, createBlock as y, withCtx as N, createTextVNode as k, createElementVNode as b, createCommentVNode as V, vShow as R, toDisplayString as te } from "vue";
2
- import { mdiAccountCircle as oe, mdiChevronDown as ae, mdiMagnify as le, mdiMenu as re } from "@mdi/js";
3
- import ie from "numeral";
4
- import de from "@kiva/kv-tokens";
5
- import ue from "../KvMaterialIcon.js";
6
- import me from "../KvIconBag.js";
7
- import se from "./KvHeaderDropdownLink.js";
8
- import ve from "../KvUserAvatar.js";
9
- import { throttle as ce } from "../../utils/throttle.js";
10
- import { isLegacyPlaceholderAvatar as we } from "../../utils/imageUtils.js";
1
+ import { defineAsyncComponent as h, ref as i, inject as ne, computed as T, watch as V, onMounted as te, onUnmounted as oe, resolveComponent as g, resolveDirective as ae, openBlock as d, createElementBlock as v, withDirectives as f, normalizeClass as A, withModifiers as K, createVNode as w, createBlock as R, withCtx as E, createTextVNode as b, createElementVNode as L, createCommentVNode as z, normalizeStyle as N, vShow as W, toDisplayString as le } from "vue";
2
+ import { mdiAccountCircle as ie, mdiChevronDown as re, mdiMagnify as de, mdiMenu as se } from "@mdi/js";
3
+ import ue from "numeral";
4
+ import me from "@kiva/kv-tokens";
5
+ import ce from "../KvMaterialIcon.js";
6
+ import ve from "../KvIconBag.js";
7
+ import fe from "./KvHeaderDropdownLink.js";
8
+ import we from "../KvUserAvatar.js";
9
+ import ke from "../KvLoadingPlaceholder.js";
10
+ import { throttle as Me } from "../../utils/throttle.js";
11
+ import { isLegacyPlaceholderAvatar as j } from "../../utils/imageUtils.js";
11
12
  import "./KvHeaderLinkBar.css";
12
- import fe from "../../_virtual/_plugin-vue_export-helper.js";
13
- const Me = h(() => import("./KvHeaderMobileMenu.js")), F = h(() => import("./KvHeaderMyKivaMenu.js")), ke = h(() => import("./LendMenu/KvLendMenu.js")), be = h(() => import("./KvHeaderTakeActionMenu.js")), he = h(() => import("./KvHeaderAboutMenu.js")), W = 150, w = "avatar-menu", I = "menuButton", z = { top: "-3.75rem", width: "100%" }, ge = "lendButton", Te = "takeActionButton", pe = "aboutUsLink", Ae = {
13
+ import ge from "../../_virtual/_plugin-vue_export-helper.js";
14
+ const be = h(() => import("./KvHeaderMobileMenu.js")), F = h(() => import("./KvHeaderMyKivaMenu.js")), he = h(() => import("./LendMenu/KvLendMenu.js")), ye = h(() => import("./KvHeaderTakeActionMenu.js")), pe = h(() => import("./KvHeaderAboutMenu.js")), q = 150, k = "avatar-menu", U = "menuButton", G = { top: "-3.75rem", width: "100%" }, Te = "lendButton", Ae = "takeActionButton", Le = "aboutUsLink", Ue = {
14
15
  components: {
15
- KvMaterialIcon: ue,
16
- KvIconBag: me,
17
- KvHeaderDropdownLink: se,
18
- KvUserAvatar: ve
16
+ KvMaterialIcon: ce,
17
+ KvIconBag: ve,
18
+ KvHeaderDropdownLink: fe,
19
+ KvUserAvatar: we,
20
+ KvLoadingPlaceholder: ke
19
21
  },
20
22
  props: {
21
23
  loggedIn: {
@@ -53,255 +55,287 @@ const Me = h(() => import("./KvHeaderMobileMenu.js")), F = h(() => import("./KvH
53
55
  balance: {
54
56
  type: Number,
55
57
  default: 0
58
+ },
59
+ isBasketDataLoading: {
60
+ type: Boolean,
61
+ default: !1
62
+ },
63
+ isUserDataLoading: {
64
+ type: Boolean,
65
+ default: !1
56
66
  }
57
67
  },
58
68
  emits: [
59
69
  "item-hover"
60
70
  ],
61
- setup(d, { emit: n }) {
62
- const a = l(null), e = l(null), K = l(null), x = l(null), g = l(null), f = l(null), U = l(null), H = l(null), u = l(null), o = l(null), O = Z("$kvTrackEvent"), _ = {
63
- [ge]: { action: "hover-Lend-menu", label: "Lend" },
64
- [Te]: { action: "hover-Take-action-menu", label: "Take action" },
65
- [pe]: { action: "hover-About-menu", label: "About" },
66
- [I]: { action: "hover-Hamburger-menu", label: "Hamburger" },
67
- [w]: { action: "hover-Avatar-menu", label: "Avatar" }
68
- }, m = (t, s, v = null) => {
69
- n("item-hover", t, s, v);
70
- }, j = (t, s, v = null) => {
71
+ setup(s, { emit: n }) {
72
+ const o = i(null), e = i(null), x = i(null), _ = i(null), y = i(null), M = i(null), B = i(null), I = i(null), H = i(null), a = i(null), l = ne("$kvTrackEvent"), O = {
73
+ [Te]: { action: "hover-Lend-menu", label: "Lend" },
74
+ [Ae]: { action: "hover-Take-action-menu", label: "Take action" },
75
+ [Le]: { action: "hover-About-menu", label: "About" },
76
+ [U]: { action: "hover-Hamburger-menu", label: "Hamburger" },
77
+ [k]: { action: "hover-Avatar-menu", label: "Avatar" }
78
+ }, u = (t, m, c = null) => {
79
+ n("item-hover", t, m, c);
80
+ }, J = (t, m, c = null) => {
71
81
  if (!navigator.maxTouchPoints) {
72
- if (t && o.value !== t) {
73
- const r = _[t];
74
- r && O(
82
+ if (t && a.value !== t) {
83
+ const r = O[t];
84
+ r && l(
75
85
  "TopNav",
76
86
  r.action,
77
87
  r.label
78
88
  );
79
89
  }
80
- o.value = t, m(
90
+ a.value = t, u(
81
91
  t,
82
- s,
83
- t === I && d.isMobile ? z : v
92
+ m,
93
+ t === U && s.isMobile ? G : c
84
94
  );
85
95
  }
86
- }, q = (t) => {
87
- !navigator.maxTouchPoints && o.value === t && (o.value = null, m());
88
- }, C = () => {
89
- var S;
90
- const t = (S = a.value) == null ? void 0 : S.getBoundingClientRect();
96
+ }, Q = (t) => {
97
+ !navigator.maxTouchPoints && a.value === t && (a.value = null, u());
98
+ }, S = () => {
99
+ var P;
100
+ const t = (P = o.value) == null ? void 0 : P.getBoundingClientRect();
91
101
  if (!t) return null;
92
- const v = t.left + t.width / 2 - W / 2, r = `${window.innerWidth - v - W}px`;
102
+ const c = t.left + t.width / 2 - q / 2, r = `${window.innerWidth - c - q}px`;
93
103
  return {
94
- right: (window == null ? void 0 : window.innerWidth) < de.breakpoints.md ? 0 : r
104
+ right: (window == null ? void 0 : window.innerWidth) < me.breakpoints.md ? 0 : r
95
105
  };
96
- }, T = () => {
97
- o.value = w, m(a.value, F, C());
98
- }, G = (t, s, v) => {
99
- if (t && o.value !== t) {
100
- const r = _[t];
101
- r && O(
106
+ }, p = () => {
107
+ a.value = k, u(o.value, F, S());
108
+ }, X = (t, m, c) => {
109
+ if (t && a.value !== t) {
110
+ const r = O[t];
111
+ r && l(
102
112
  "TopNav",
103
113
  r.action,
104
114
  r.label
105
115
  );
106
116
  }
107
- o.value === I && (o.value = null), !o.value || o.value !== t ? (o.value = t, t === w ? T() : t === I && d.isMobile ? m(t, s, z) : m(t, s, v)) : (o.value = null, m());
108
- }, D = ce(() => {
109
- o.value === w && T();
110
- }, 100), J = L(() => d.isMobile ? void 0 : "/lend-by-category"), Q = L(() => {
117
+ a.value === U && (a.value = null), !a.value || a.value !== t ? (a.value = t, t === k ? p() : t === U && s.isMobile ? u(t, m, G) : u(t, m, c)) : (a.value = null, u());
118
+ }, C = Me(() => {
119
+ a.value === k && p();
120
+ }, 100), Y = T(() => s.isMobile ? void 0 : "/lend-by-category"), D = T(() => {
111
121
  var t;
112
- return ((t = d.lenderImageUrl) == null ? void 0 : t.split("/").pop()) ?? "";
113
- }), X = L(() => Math.floor(d.balance)), Y = (t) => {
114
- t.target === t.currentTarget && m();
122
+ return ((t = s.lenderImageUrl) == null ? void 0 : t.split("/").pop()) ?? "";
123
+ }), Z = T(() => Math.floor(s.balance)), $ = T(() => j(D.value) || !D.value), ee = (t) => {
124
+ t.target === t.currentTarget && u();
115
125
  };
116
- return P(
117
- () => d.isMobile,
126
+ return V(
127
+ () => s.isMobile,
118
128
  () => {
119
- o.value === w && T();
129
+ a.value === k && p();
120
130
  }
121
- ), P(
122
- () => d.openMenuItem,
131
+ ), V(
132
+ () => s.openMenuItem,
123
133
  (t) => {
124
- t || (o.value = null);
134
+ t || (a.value = null);
125
135
  }
126
- ), $(() => {
127
- import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", D);
128
- }), ee(() => {
129
- window.removeEventListener("resize", D);
136
+ ), te(() => {
137
+ import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", C);
138
+ }), oe(() => {
139
+ window.removeEventListener("resize", C);
130
140
  }), {
131
- AVATAR_MENU_ID: w,
132
- openMenuId: o,
133
- numeral: ie,
134
- mdiAccountCircle: oe,
135
- mdiChevronDown: ae,
136
- mdiMagnify: le,
137
- mdiMenu: re,
138
- onHover: m,
139
- avatar: a,
141
+ AVATAR_MENU_ID: k,
142
+ openMenuId: a,
143
+ numeral: ue,
144
+ mdiAccountCircle: ie,
145
+ mdiChevronDown: re,
146
+ mdiMagnify: de,
147
+ mdiMenu: se,
148
+ onHover: u,
149
+ avatar: o,
140
150
  lendButton: e,
141
- aboutUsLink: K,
142
- partnerWithUsLink: x,
143
- borrowLink: g,
144
- supportKivaLink: f,
145
- basketLink: U,
146
- signInLink: H,
147
- menuButton: u,
148
- lendUrl: J,
149
- avatarFilename: Q,
150
- handleOnHover: j,
151
- handleTouchStart: G,
152
- handleMouseOut: q,
153
- handleAvatarMenuPosition: T,
154
- KvHeaderMobileMenu: Me,
151
+ aboutUsLink: x,
152
+ partnerWithUsLink: _,
153
+ borrowLink: y,
154
+ supportKivaLink: M,
155
+ basketLink: B,
156
+ signInLink: I,
157
+ menuButton: H,
158
+ lendUrl: Y,
159
+ avatarFilename: D,
160
+ handleOnHover: J,
161
+ handleTouchStart: X,
162
+ handleMouseOut: Q,
163
+ handleAvatarMenuPosition: p,
164
+ KvHeaderMobileMenu: be,
155
165
  KvHeaderMyKivaMenu: F,
156
- KvLendMenu: ke,
157
- KvHeaderTakeActionMenu: be,
158
- KvHeaderAboutMenu: he,
159
- isLegacyPlaceholderAvatar: we,
160
- getAvatarMenuPosition: C,
161
- handleEmptySpaceClick: Y,
162
- roundedBalance: X
166
+ KvLendMenu: he,
167
+ KvHeaderTakeActionMenu: ye,
168
+ KvHeaderAboutMenu: pe,
169
+ isLegacyPlaceholderAvatar: j,
170
+ getAvatarMenuPosition: S,
171
+ handleEmptySpaceClick: ee,
172
+ roundedBalance: Z,
173
+ isDefaultProfilePic: $
163
174
  };
164
175
  }
165
- }, ye = ["href"], Ie = {
176
+ }, Be = ["href"], Ie = {
166
177
  ref: "avatar",
167
178
  class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-bg-eco-green-1 tw-rounded-md tw-py-0.5 md:tw-py-1 tw-px-1 md:tw-px-2"
168
- }, Ue = { class: "tw-text-eco-green-4" }, He = ["href"];
169
- function Le(d, n, a, e, K, x) {
170
- const g = p("kv-material-icon"), f = p("KvHeaderDropdownLink"), U = p("kv-icon-bag"), H = p("KvUserAvatar"), u = ne("kv-track-event");
171
- return i(), M("div", {
179
+ }, He = {
180
+ key: 0,
181
+ class: "tw-w-4 tw-h-3",
182
+ style: {
183
+ display: "var(--user-balance-loading-display, inline-block)"
184
+ }
185
+ }, De = {
186
+ key: 1,
187
+ class: "tw-text-eco-green-4"
188
+ }, Ke = ["href"];
189
+ function Ee(s, n, o, e, x, _) {
190
+ const y = g("kv-material-icon"), M = g("KvHeaderDropdownLink"), B = g("kv-icon-bag"), I = g("KvUserAvatar"), H = g("KvLoadingPlaceholder"), a = ae("kv-track-event");
191
+ return d(), v("div", {
172
192
  class: "tw-h-full tw-flex tw-items-center tw-gap-0.5 md:tw-gap-2 lg:tw-gap-2.5",
173
- onTouchstart: n[10] || (n[10] = (...o) => e.handleEmptySpaceClick && e.handleEmptySpaceClick(...o))
193
+ onTouchstart: n[10] || (n[10] = (...l) => e.handleEmptySpaceClick && e.handleEmptySpaceClick(...l))
174
194
  }, [
175
- c((i(), M("button", {
195
+ f((d(), v("button", {
176
196
  ref: "menuButton",
177
197
  class: A(["header-link tw-inline-flex md:tw-hidden", {
178
- "tw-text-tertiary": a.openMenuItem && a.openMenuItem !== e.KvHeaderMobileMenu
198
+ "tw-text-tertiary": o.openMenuItem && o.openMenuItem !== e.KvHeaderMobileMenu
179
199
  }]),
180
- onMouseover: n[0] || (n[0] = (o) => e.handleOnHover("menuButton", e.KvHeaderMobileMenu)),
181
- onMouseout: n[1] || (n[1] = (o) => e.handleMouseOut("menuButton")),
182
- onTouchstart: n[2] || (n[2] = B((o) => e.handleTouchStart("menuButton", e.KvHeaderMobileMenu), ["stop"]))
200
+ onMouseover: n[0] || (n[0] = (l) => e.handleOnHover("menuButton", e.KvHeaderMobileMenu)),
201
+ onMouseout: n[1] || (n[1] = (l) => e.handleMouseOut("menuButton")),
202
+ onTouchstart: n[2] || (n[2] = K((l) => e.handleTouchStart("menuButton", e.KvHeaderMobileMenu), ["stop"]))
183
203
  }, [
184
- E(g, { icon: e.mdiMenu }, null, 8, ["icon"])
204
+ w(y, { icon: e.mdiMenu }, null, 8, ["icon"])
185
205
  ], 34)), [
186
- [u, a.openMenuItem === e.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
206
+ [a, o.openMenuItem === e.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
187
207
  ]),
188
- c((i(), y(f, {
208
+ f((d(), R(M, {
189
209
  class: "tw-py-1",
190
210
  "ref-name": "lendButton",
191
211
  href: e.lendUrl,
192
212
  "menu-component": e.KvLendMenu,
193
- "open-menu-item": a.openMenuItem,
213
+ "open-menu-item": o.openMenuItem,
194
214
  "dropdown-icon": e.mdiChevronDown,
195
215
  "base-class": "tw-inline-flex md:tw-border md:tw-rounded-md tw-px-1.5 tw-py-0.5",
196
216
  onOnHover: e.handleOnHover,
197
- onMouseleave: n[3] || (n[3] = (o) => e.handleMouseOut("lendButton")),
198
- onTouchstart: n[4] || (n[4] = B((o) => e.handleTouchStart("lendButton", e.KvLendMenu), ["stop"]))
217
+ onMouseleave: n[3] || (n[3] = (l) => e.handleMouseOut("lendButton")),
218
+ onTouchstart: n[4] || (n[4] = K((l) => e.handleTouchStart("lendButton", e.KvLendMenu), ["stop"]))
199
219
  }, {
200
- default: N(() => n[11] || (n[11] = [
201
- k(" Lend ")
220
+ default: E(() => n[11] || (n[11] = [
221
+ b(" Lend ")
202
222
  ])),
203
223
  _: 1
204
224
  }, 8, ["href", "menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
205
- [u, ["TopNav", "click-Lend"]]
225
+ [a, ["TopNav", "click-Lend"]]
206
226
  ]),
207
- c((i(), y(f, {
227
+ f((d(), R(M, {
208
228
  "ref-name": "takeActionButton",
209
229
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
210
230
  "menu-component": e.KvHeaderTakeActionMenu,
211
- "open-menu-item": a.openMenuItem,
231
+ "open-menu-item": o.openMenuItem,
212
232
  "dropdown-icon": e.mdiChevronDown,
213
233
  "send-link-position": "",
214
234
  onOnHover: e.handleOnHover,
215
- onMouseleave: n[5] || (n[5] = (o) => e.handleMouseOut("takeActionButton")),
235
+ onMouseleave: n[5] || (n[5] = (l) => e.handleMouseOut("takeActionButton")),
216
236
  onUserTap: e.handleTouchStart
217
237
  }, {
218
- default: N(() => n[12] || (n[12] = [
219
- k(" Take action ")
238
+ default: E(() => n[12] || (n[12] = [
239
+ b(" Take action ")
220
240
  ])),
221
241
  _: 1
222
242
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"])), [
223
- [u, ["TopNav", "click-take-action"]]
243
+ [a, ["TopNav", "click-take-action"]]
224
244
  ]),
225
- E(f, {
245
+ w(M, {
226
246
  "ref-name": "aboutUsLink",
227
247
  "data-testid": "header-about",
228
248
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
229
249
  "menu-component": e.KvHeaderAboutMenu,
230
- "open-menu-item": a.openMenuItem,
250
+ "open-menu-item": o.openMenuItem,
231
251
  "dropdown-icon": e.mdiChevronDown,
232
252
  "send-link-position": "",
233
253
  onOnHover: e.handleOnHover,
234
- onMouseleave: n[6] || (n[6] = (o) => e.handleMouseOut("aboutUsLink")),
254
+ onMouseleave: n[6] || (n[6] = (l) => e.handleMouseOut("aboutUsLink")),
235
255
  onUserTap: e.handleTouchStart
236
256
  }, {
237
- default: N(() => n[13] || (n[13] = [
238
- k(" About ")
257
+ default: E(() => n[13] || (n[13] = [
258
+ b(" About ")
239
259
  ])),
240
260
  _: 1
241
261
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"]),
242
- n[17] || (n[17] = b("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
243
- a.loggedIn ? c((i(), M("a", {
262
+ n[17] || (n[17] = L("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
263
+ o.loggedIn ? f((d(), v("a", {
244
264
  key: 0,
245
265
  ref: "dashboardLink",
246
- href: a.myDashboardUrl,
247
- class: A(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!a.openMenuItem }])
266
+ href: o.myDashboardUrl,
267
+ class: A(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!o.openMenuItem }])
248
268
  }, n[14] || (n[14] = [
249
- k(" My dashboard ")
250
- ]), 10, ye)), [
251
- [u, ["TopNav", "click-Dashboard"]]
252
- ]) : V("", !0),
253
- c((i(), M("a", {
269
+ b(" My dashboard ")
270
+ ]), 10, Be)), [
271
+ [a, ["TopNav", "click-Dashboard"]]
272
+ ]) : z("", !0),
273
+ f((d(), v("a", {
254
274
  ref: "basketLink",
255
275
  href: "/basket",
256
- class: A(["header-link tw-relative md:!tw-mr-0 tw-flex tw-items-center tw-gap-0.5", { "tw-text-tertiary": !!a.openMenuItem }]),
257
- style: { "margin-right": "2px" },
276
+ class: A(["header-link tw-relative md:!tw-mr-0 tw-flex tw-items-center tw-gap-0.5", { "tw-text-tertiary": !!o.openMenuItem }]),
277
+ style: N([o.isBasketDataLoading ? {
278
+ display: "var(--basket-display, flex)"
279
+ } : void 0, { "margin-right": "2px" }]),
258
280
  "data-testid": "header-basket"
259
281
  }, [
260
- E(U, {
282
+ w(B, {
261
283
  class: "tw-w-3 tw-h-3 md:tw-w-3.5 md:tw-h-3.5 tw-pointer-events-none tw-text-action",
262
- count: a.basketCount
284
+ count: o.isBasketDataLoading ? 0 : o.basketCount
263
285
  }, null, 8, ["count"]),
264
- n[15] || (n[15] = b("span", { class: "tw-hidden md:tw-block" }, "Basket", -1))
265
- ], 2)), [
266
- [R, a.basketCount > 0],
267
- [u, ["TopNav", "click-Basket"]]
286
+ n[15] || (n[15] = L("span", { class: "tw-hidden md:tw-block" }, "Basket", -1))
287
+ ], 6)), [
288
+ [W, o.isBasketDataLoading ? !0 : o.basketCount > 0],
289
+ [a, ["TopNav", "click-Basket"]]
268
290
  ]),
269
- b("div", {
291
+ L("div", {
270
292
  class: "md:tw-py-1",
271
- onMouseenter: n[7] || (n[7] = (o) => e.handleOnHover(e.AVATAR_MENU_ID, e.KvHeaderMyKivaMenu, e.getAvatarMenuPosition())),
272
- onMouseleave: n[8] || (n[8] = (o) => e.handleMouseOut(e.AVATAR_MENU_ID)),
273
- onTouchstart: n[9] || (n[9] = B((o) => e.handleTouchStart(e.AVATAR_MENU_ID), ["stop"]))
293
+ onMouseenter: n[7] || (n[7] = (l) => e.handleOnHover(e.AVATAR_MENU_ID, e.KvHeaderMyKivaMenu, e.getAvatarMenuPosition())),
294
+ onMouseleave: n[8] || (n[8] = (l) => e.handleMouseOut(e.AVATAR_MENU_ID)),
295
+ onTouchstart: n[9] || (n[9] = K((l) => e.handleTouchStart(e.AVATAR_MENU_ID), ["stop"]))
274
296
  }, [
275
- c(b("div", Ie, [
276
- e.isLegacyPlaceholderAvatar(e.avatarFilename) || !e.avatarFilename ? (i(), y(g, {
277
- key: 0,
297
+ f(L("div", Ie, [
298
+ w(y, {
278
299
  icon: e.mdiAccountCircle,
279
- class: "tw-w-3"
280
- }, null, 8, ["icon"])) : (i(), y(H, {
281
- key: 1,
282
- class: "avatar",
283
- "lender-name": a.lenderName,
284
- "lender-image-url": a.lenderImageUrl,
300
+ class: "tw-w-3",
301
+ style: N(o.isUserDataLoading ? {
302
+ display: "var(--user-avatar-legacy-display, inline-block)"
303
+ } : {
304
+ display: e.isDefaultProfilePic ? "inline-block" : "none"
305
+ })
306
+ }, null, 8, ["icon", "style"]),
307
+ w(I, {
308
+ class: "tw-w-3 tw-h-3",
309
+ "lender-name": o.lenderName,
310
+ "lender-image-url": o.lenderImageUrl,
311
+ style: N(o.isUserDataLoading ? {
312
+ display: "var(--user-avatar-display, inline-block)"
313
+ } : {
314
+ display: e.isDefaultProfilePic ? "none" : "inline-block"
315
+ }),
316
+ "show-css-placeholder": o.isUserDataLoading,
285
317
  "is-small": ""
286
- }, null, 8, ["lender-name", "lender-image-url"])),
287
- b("span", Ue, te(e.numeral(e.roundedBalance).format("$0")), 1)
318
+ }, null, 8, ["lender-name", "lender-image-url", "style", "show-css-placeholder"]),
319
+ o.isUserDataLoading ? (d(), v("div", He, [
320
+ w(H)
321
+ ])) : (d(), v("span", De, le(e.numeral(e.roundedBalance).format("$0")), 1))
288
322
  ], 512), [
289
- [R, a.loggedIn]
323
+ [W, o.loggedIn]
290
324
  ])
291
325
  ], 32),
292
- a.loggedIn ? V("", !0) : c((i(), M("a", {
326
+ o.loggedIn ? z("", !0) : f((d(), v("a", {
293
327
  key: 1,
294
328
  ref: "signInLink",
295
- href: a.loginUrl,
296
- class: A(["header-link", { "tw-text-tertiary": !!a.openMenuItem }])
329
+ href: o.loginUrl,
330
+ class: A(["header-link", { "tw-text-tertiary": !!o.openMenuItem }])
297
331
  }, n[16] || (n[16] = [
298
- k(" Sign in ")
299
- ]), 10, He)), [
300
- [u, ["TopNav", "click-Sign-in"]]
332
+ b(" Sign in ")
333
+ ]), 10, Ke)), [
334
+ [a, ["TopNav", "click-Sign-in"]]
301
335
  ])
302
336
  ], 32);
303
337
  }
304
- const Fe = /* @__PURE__ */ fe(Ae, [["render", Le], ["__scopeId", "data-v-d30fd983"]]);
338
+ const Ge = /* @__PURE__ */ ge(Ue, [["render", Ee], ["__scopeId", "data-v-c31f1fca"]]);
305
339
  export {
306
- Fe as default
340
+ Ge as default
307
341
  };
@@ -1 +1 @@
1
- .header-fade-enter-active[data-v-7732c044]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-7732c044]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-7732c044],.header-fade-leave-to[data-v-7732c044]{opacity:0}.header-fade-leave[data-v-7732c044],.header-fade-enter-to[data-v-7732c044]{opacity:1}.bg-opacity-50[data-v-7732c044]{background-color:rgba(var(--bg-action-highlight),.5)}
1
+ .header-fade-enter-active[data-v-137228da]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-137228da]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-137228da],.header-fade-leave-to[data-v-137228da]{opacity:0}.header-fade-leave[data-v-137228da],.header-fade-enter-to[data-v-137228da]{opacity:1}.bg-opacity-50[data-v-137228da]{background-color:rgba(var(--bg-action-highlight),.5)}
@@ -1,4 +1,4 @@
1
- import { ref as a, shallowRef as N, computed as S, onMounted as x, onBeforeUnmount as A, resolveComponent as w, resolveDirective as K, openBlock as g, createBlock as E, withCtx as b, createElementVNode as k, normalizeStyle as h, createVNode as v, Transition as I, withDirectives as y, vShow as C, createElementBlock as O, normalizeClass as G, resolveDynamicComponent as z, withModifiers as P } from "vue";
1
+ import { ref as a, shallowRef as N, computed as S, onMounted as x, onBeforeUnmount as A, resolveComponent as g, resolveDirective as K, openBlock as b, createBlock as L, withCtx as w, createElementVNode as k, normalizeStyle as h, createVNode as v, Transition as E, withDirectives as y, vShow as I, createElementBlock as O, normalizeClass as G, resolveDynamicComponent as z, withModifiers as P } from "vue";
2
2
  import R from "@kiva/kv-tokens";
3
3
  import V from "./KvWwwHeader/KvHeaderLinkBar.js";
4
4
  import W from "./KvWwwHeader/KvHeaderLogo.js";
@@ -32,6 +32,10 @@ const Q = "4rem", X = ["lendMenu", "aboutUsLink", "takeActionButton"], Z = {
32
32
  type: Number,
33
33
  default: 0
34
34
  },
35
+ isBasketDataLoading: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
35
39
  isBorrower: {
36
40
  type: Boolean,
37
41
  default: !1
@@ -40,6 +44,10 @@ const Q = "4rem", X = ["lendMenu", "aboutUsLink", "takeActionButton"], Z = {
40
44
  type: Boolean,
41
45
  default: !1
42
46
  },
47
+ isUserDataLoading: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
43
51
  userId: {
44
52
  type: Number,
45
53
  default: null
@@ -68,42 +76,42 @@ const Q = "4rem", X = ["lendMenu", "aboutUsLink", "takeActionButton"], Z = {
68
76
  emits: [
69
77
  "load-lend-menu-data"
70
78
  ],
71
- setup(L, { emit: o }) {
72
- const n = a(!0), e = a(null), r = a(!1), i = N(null), d = a(null), m = a({ left: 0, position: "relative" }), s = a(!1), c = a(null), f = a(!1), l = S(() => {
73
- var u, t;
74
- return ((t = (u = d.value) == null ? void 0 : u.$options) == null ? void 0 : t.name) === "KvHeaderMobileMenu";
75
- }), _ = F((u, t, H) => {
76
- f.value && (t ? (c.value = u, i.value !== t && (m.value = { left: 0, position: "relative" }), i.value = t, r.value = !0, H && (m.value = {
77
- ...H,
79
+ setup(C, { emit: o }) {
80
+ const n = a(!0), e = a(null), i = a(!1), r = N(null), u = a(null), m = a({ left: 0, position: "relative" }), s = a(!1), c = a(null), f = a(!1), l = S(() => {
81
+ var d, t;
82
+ return ((t = (d = u.value) == null ? void 0 : d.$options) == null ? void 0 : t.name) === "KvHeaderMobileMenu";
83
+ }), _ = F((d, t, p) => {
84
+ f.value && (t ? (c.value = d, r.value !== t && (m.value = { left: 0, position: "relative" }), r.value = t, i.value = !0, p && (m.value = {
85
+ ...p,
78
86
  position: "absolute"
79
- })) : r.value && (r.value = !1, i.value = null));
80
- }, 100), T = (u) => {
87
+ })) : i.value && (i.value = !1, r.value = null));
88
+ }, 100), D = (d) => {
81
89
  var t;
82
- (t = d.value) == null || t.onLoad(u);
90
+ (t = u.value) == null || t.onLoad(d);
83
91
  }, U = () => {
84
92
  if (!l.value) return _();
85
- }, D = () => {
93
+ }, B = () => {
86
94
  o("load-lend-menu-data");
87
- }, B = () => s.value && X.includes(c.value) || !s.value && l.value, M = () => {
88
- s.value = (window == null ? void 0 : window.innerWidth) < R.breakpoints.md, B() && (i.value = null, r.value = !1);
89
- }, p = q(M, 100);
95
+ }, T = () => s.value && X.includes(c.value) || !s.value && l.value, M = () => {
96
+ s.value = (window == null ? void 0 : window.innerWidth) < R.breakpoints.md, T() && (r.value = null, i.value = !1);
97
+ }, H = q(M, 100);
90
98
  return x(() => {
91
- M(), window.addEventListener("resize", p), f.value = !0;
99
+ M(), window.addEventListener("resize", H), f.value = !0;
92
100
  }), A(() => {
93
- window.removeEventListener("resize", p);
101
+ window.removeEventListener("resize", H);
94
102
  }), {
95
103
  HEADER_HEIGHT: Q,
96
- emitLendMenuEvent: D,
104
+ emitLendMenuEvent: B,
97
105
  isMobile: s,
98
106
  linksVisible: n,
99
- menuOpen: r,
107
+ menuOpen: i,
100
108
  isMobileMenuActive: l,
101
109
  onHover: _,
102
- loadMenuData: T,
110
+ loadMenuData: D,
103
111
  handleOverlayClick: U,
104
112
  activeHeaderItem: e,
105
- menuComponent: i,
106
- menuComponentInstance: d,
113
+ menuComponent: r,
114
+ menuComponentInstance: u,
107
115
  menuPosition: m
108
116
  };
109
117
  }
@@ -111,22 +119,24 @@ const Q = "4rem", X = ["lendMenu", "aboutUsLink", "takeActionButton"], Z = {
111
119
  href: "/",
112
120
  class: "tw-px-1 tw-py-2 tw-cursor-pointer tw-absolute tw-top-1/2 tw-left-1/2 tw--translate-y-1/2 tw--translate-x-1/2 tw-transition-all tw-duration-300"
113
121
  };
114
- function ee(L, o, n, e, r, i) {
115
- const d = w("kv-header-link-bar"), m = w("kv-header-logo"), s = w("kv-page-container"), c = w("kv-theme-provider"), f = K("kv-track-event");
116
- return g(), E(c, {
122
+ function ee(C, o, n, e, i, r) {
123
+ const u = g("kv-header-link-bar"), m = g("kv-header-logo"), s = g("kv-page-container"), c = g("kv-theme-provider"), f = K("kv-track-event");
124
+ return b(), L(c, {
117
125
  tag: "div",
118
126
  class: "tw-bg-primary"
119
127
  }, {
120
- default: b(() => [
128
+ default: w(() => [
121
129
  k("nav", {
122
130
  class: "tw-font-medium tw-relative",
123
131
  style: h({ height: e.HEADER_HEIGHT })
124
132
  }, [
125
133
  v(s, { class: "tw-h-full" }, {
126
- default: b(() => [
127
- v(I, { name: "header-fade" }, {
128
- default: b(() => [
129
- y(v(d, {
134
+ default: w(() => [
135
+ v(E, { name: "header-fade" }, {
136
+ default: w(() => [
137
+ y(v(u, {
138
+ "is-basket-data-loading": n.isBasketDataLoading,
139
+ "is-user-data-loading": n.isUserDataLoading,
130
140
  "logged-in": n.loggedIn,
131
141
  "basket-count": n.basketCount,
132
142
  "login-url": n.loginUrl,
@@ -137,13 +147,13 @@ function ee(L, o, n, e, r, i) {
137
147
  "is-mobile": e.isMobile,
138
148
  balance: n.balance,
139
149
  onItemHover: e.onHover
140
- }, null, 8, ["logged-in", "basket-count", "login-url", "open-menu-item", "my-dashboard-url", "lender-name", "lender-image-url", "is-mobile", "balance", "onItemHover"]), [
141
- [C, e.linksVisible]
150
+ }, null, 8, ["is-basket-data-loading", "is-user-data-loading", "logged-in", "basket-count", "login-url", "open-menu-item", "my-dashboard-url", "lender-name", "lender-image-url", "is-mobile", "balance", "onItemHover"]), [
151
+ [I, e.linksVisible]
142
152
  ])
143
153
  ]),
144
154
  _: 1
145
155
  }),
146
- y((g(), O("a", $, [
156
+ y((b(), O("a", $, [
147
157
  v(m)
148
158
  ])), [
149
159
  [f, ["TopNav", "click-Logo"]]
@@ -152,8 +162,8 @@ function ee(L, o, n, e, r, i) {
152
162
  _: 1
153
163
  })
154
164
  ], 4),
155
- v(I, { name: "header-fade" }, {
156
- default: b(() => [
165
+ v(E, { name: "header-fade" }, {
166
+ default: w(() => [
157
167
  y(k("div", {
158
168
  class: "tw-absolute tw-z-modal tw-h-full tw-inset-x-0 tw-bg-eco-green-4 bg-opacity-50 tw-min-h-screen",
159
169
  style: h({ top: e.HEADER_HEIGHT }),
@@ -168,7 +178,7 @@ function ee(L, o, n, e, r, i) {
168
178
  onMouseenter: o[2] || (o[2] = (l) => e.onHover(e.activeHeaderItem, e.menuComponent)),
169
179
  onMouseleave: o[3] || (o[3] = (l) => e.onHover())
170
180
  }, [
171
- (g(), E(z(e.menuComponent), {
181
+ (b(), L(z(e.menuComponent), {
172
182
  ref: "menuComponentInstance",
173
183
  "logged-in": n.loggedIn,
174
184
  "login-url": n.loginUrl,
@@ -186,7 +196,7 @@ function ee(L, o, n, e, r, i) {
186
196
  }, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "countries-not-lent-to-url", "onLoadLendMenuData"]))
187
197
  ], 38)
188
198
  ], 36), [
189
- [C, e.menuOpen]
199
+ [I, e.menuOpen]
190
200
  ])
191
201
  ]),
192
202
  _: 1
@@ -195,7 +205,7 @@ function ee(L, o, n, e, r, i) {
195
205
  _: 1
196
206
  });
197
207
  }
198
- const me = /* @__PURE__ */ J(Z, [["render", ee], ["__scopeId", "data-v-7732c044"]]);
208
+ const me = /* @__PURE__ */ J(Z, [["render", ee], ["__scopeId", "data-v-137228da"]]);
199
209
  export {
200
210
  me as default
201
211
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.69.3",
3
+ "version": "7.0.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -114,5 +114,5 @@
114
114
  "embla-carousel-fade",
115
115
  "popper.js"
116
116
  ],
117
- "gitHead": "f6ec5ff169304eff0c80651237eadcf8e79505d6"
117
+ "gitHead": "d1d979db0ae3e33f4b8b8a1d04a802ffb0c733ee"
118
118
  }
@@ -1 +0,0 @@
1
- .activity-avatar[data-v-84a9404c],.activity-avatar[data-v-84a9404c] img,.activity-avatar[data-v-84a9404c] div{height:2rem;width:2rem}
@@ -1 +0,0 @@
1
- .adjust-vertical-spacing[data-v-c9339e78]{top:-.1rem;position:relative}