@kiva/kv-components 6.53.0 → 6.53.1

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
- .header-link[data-v-6728d6d1]{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-6728d6d1]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
1
+ .header-link[data-v-69cf3729]{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-69cf3729]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
@@ -1,17 +1,18 @@
1
- import { defineAsyncComponent as k, ref as r, computed as j, onMounted as q, onUnmounted as G, resolveComponent as h, resolveDirective as J, openBlock as i, createElementBlock as m, withDirectives as s, normalizeClass as p, createVNode as D, createBlock as w, withCtx as L, createTextVNode as M, createElementVNode as C, createCommentVNode as y, vShow as Q, toDisplayString as X, Fragment as Y } from "vue";
2
- import { mdiAccountCircle as Z, mdiChevronDown as $, mdiMagnify as ee, mdiMenu as ne } from "@mdi/js";
3
- import te from "numeral";
4
- import oe from "../KvMaterialIcon.js";
5
- import le from "../KvIconBag.js";
1
+ import { defineAsyncComponent as k, ref as a, computed as D, onMounted as G, onUnmounted as J, resolveComponent as h, resolveDirective as Q, openBlock as r, createElementBlock as s, withDirectives as v, normalizeClass as p, createVNode as C, createBlock as w, withCtx as L, createTextVNode as M, createElementVNode as E, createCommentVNode as y, vShow as X, toDisplayString as Y, Fragment as Z } from "vue";
2
+ import { mdiAccountCircle as $, mdiChevronDown as ee, mdiMagnify as ne, mdiMenu as te } from "@mdi/js";
3
+ import oe from "numeral";
4
+ import le from "../KvMaterialIcon.js";
5
+ import ae from "../KvIconBag.js";
6
6
  import re from "./KvHeaderDropdownLink.js";
7
7
  import ie from "../KvUserAvatar.js";
8
- import { throttle as ae } from "../../utils/throttle.js";
8
+ import { throttle as ue } from "../../utils/throttle.js";
9
+ import { isLegacyPlaceholderAvatar as de } from "../../utils/imageUtils.js";
9
10
  import "./KvHeaderLinkBar.css";
10
- import ue from "../../_virtual/_plugin-vue_export-helper.js";
11
- const de = k(() => import("./KvHeaderMobileMenu.js")), E = k(() => import("./KvHeaderMyKivaMenu.js")), me = k(() => import("./LendMenu/KvLendMenu.js")), se = k(() => import("./KvHeaderTakeActionMenu.js")), ve = k(() => import("./KvHeaderAboutMenu.js")), S = 146, A = "avatar-menu", B = "menuButton", V = { top: "-3.75rem", width: "100%" }, ce = {
11
+ import me from "../../_virtual/_plugin-vue_export-helper.js";
12
+ const se = k(() => import("./KvHeaderMobileMenu.js")), S = k(() => import("./KvHeaderMyKivaMenu.js")), ve = k(() => import("./LendMenu/KvLendMenu.js")), ce = k(() => import("./KvHeaderTakeActionMenu.js")), fe = k(() => import("./KvHeaderAboutMenu.js")), P = 146, A = "avatar-menu", B = "menuButton", V = { top: "-3.75rem", width: "100%" }, we = {
12
13
  components: {
13
- KvMaterialIcon: oe,
14
- KvIconBag: le,
14
+ KvMaterialIcon: le,
15
+ KvIconBag: ae,
15
16
  KvHeaderDropdownLink: re,
16
17
  KvUserAvatar: ie
17
18
  },
@@ -56,205 +57,210 @@ const de = k(() => import("./KvHeaderMobileMenu.js")), E = k(() => import("./KvH
56
57
  emits: [
57
58
  "item-hover"
58
59
  ],
59
- setup(v, { emit: e }) {
60
- const t = r(null), n = r(null), K = r(null), O = r(null), g = r(null), f = r(null), I = r(null), T = r(null), a = r(null), o = r(null), H = r(!1), b = r(), u = (l, d, c = null) => {
61
- e("item-hover", l, d, c);
62
- }, P = (l, d, c = null) => {
63
- navigator.maxTouchPoints || (o.value = l, u(
60
+ setup(u, { emit: n }) {
61
+ const t = a(null), e = a(null), K = a(null), O = a(null), g = a(null), f = a(null), I = a(null), T = a(null), i = a(null), o = a(null), H = a(!1), b = a(), d = (l, m, c = null) => {
62
+ n("item-hover", l, m, c);
63
+ }, R = (l, m, c = null) => {
64
+ navigator.maxTouchPoints || (o.value = l, d(
64
65
  l,
65
- d,
66
- l === B && v.isMobile ? V : c
66
+ m,
67
+ l === B && u.isMobile ? V : c
67
68
  ));
68
- }, R = (l) => {
69
- !H.value && o.value === l && (o.value = null, u());
69
+ }, F = (l) => {
70
+ !H.value && o.value === l && (o.value = null, d());
70
71
  }, z = () => {
71
72
  var N, _;
72
73
  const l = (_ = (N = t.value) == null ? void 0 : N.userAvatar) == null ? void 0 : _.getBoundingClientRect();
73
74
  if (!l) return null;
74
- const c = l.left + l.width / 2 - S / 2;
75
+ const c = l.left + l.width / 2 - P / 2;
75
76
  return {
76
- ...c + S > window.innerWidth ? { right: 0 } : { left: v.isMobile ? 0 : `${c}px` },
77
+ ...c + P > window.innerWidth ? { right: 0 } : { left: u.isMobile ? 0 : `${c}px` },
77
78
  marginTop: "-2px",
78
79
  // Avoid closing avatar menu on header edge
79
- borderRadius: v.isMobile ? "auto" : "0px 0px 8px 8px"
80
+ borderRadius: u.isMobile ? "auto" : "0px 0px 8px 8px"
80
81
  };
81
82
  }, x = () => {
82
- o.value = A, u(t.value, E, z());
83
- }, W = (l, d) => {
84
- b.value = null, H.value = !0, b.value && clearTimeout(b.value), o.value === B && (o.value = null), !o.value || o.value !== l ? (o.value = l, l === A ? x() : l === B && v.isMobile ? u(l, d, V) : u(l, d)) : (o.value = null, u()), b.value = setTimeout(() => {
83
+ o.value = A, d(t.value, S, z());
84
+ }, W = (l, m) => {
85
+ b.value = null, H.value = !0, b.value && clearTimeout(b.value), o.value === B && (o.value = null), !o.value || o.value !== l ? (o.value = l, l === A ? x() : l === B && u.isMobile ? d(l, m, V) : d(l, m)) : (o.value = null, d()), b.value = setTimeout(() => {
85
86
  H.value = !1;
86
87
  }, 500);
87
- }, U = ae(() => {
88
+ }, U = ue(() => {
88
89
  o.value === A && x();
89
- }, 100), F = j(() => v.isMobile ? void 0 : "/lend-by-category");
90
- return q(() => {
90
+ }, 100), j = D(() => u.isMobile ? void 0 : "/lend-by-category"), q = D(() => {
91
+ var l;
92
+ return ((l = u.lenderImageUrl) == null ? void 0 : l.split("/").pop()) ?? "";
93
+ });
94
+ return G(() => {
91
95
  import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", U);
92
- }), G(() => {
96
+ }), J(() => {
93
97
  window.removeEventListener("resize", U);
94
98
  }), {
95
99
  AVATAR_MENU_ID: A,
96
100
  openMenuId: o,
97
- numeral: te,
98
- mdiAccountCircle: Z,
99
- mdiChevronDown: $,
100
- mdiMagnify: ee,
101
- mdiMenu: ne,
102
- onHover: u,
101
+ numeral: oe,
102
+ mdiAccountCircle: $,
103
+ mdiChevronDown: ee,
104
+ mdiMagnify: ne,
105
+ mdiMenu: te,
106
+ onHover: d,
103
107
  avatar: t,
104
- lendButton: n,
108
+ lendButton: e,
105
109
  aboutUsLink: K,
106
110
  partnerWithUsLink: O,
107
111
  borrowLink: g,
108
112
  supportKivaLink: f,
109
113
  basketLink: I,
110
114
  signInLink: T,
111
- menuButton: a,
112
- lendUrl: F,
113
- handleOnHover: P,
115
+ menuButton: i,
116
+ lendUrl: j,
117
+ avatarFilename: q,
118
+ handleOnHover: R,
114
119
  handleTouchStart: W,
115
- handleMouseOut: R,
120
+ handleMouseOut: F,
116
121
  handleAvatarMenuPosition: x,
117
- KvHeaderMobileMenu: de,
118
- KvHeaderMyKivaMenu: E,
119
- KvLendMenu: me,
120
- KvHeaderTakeActionMenu: se,
121
- KvHeaderAboutMenu: ve
122
+ KvHeaderMobileMenu: se,
123
+ KvHeaderMyKivaMenu: S,
124
+ KvLendMenu: ve,
125
+ KvHeaderTakeActionMenu: ce,
126
+ KvHeaderAboutMenu: fe,
127
+ isLegacyPlaceholderAvatar: de
122
128
  };
123
129
  }
124
- }, fe = { class: "tw-h-full tw-flex tw-items-center tw-gap-0.5 md:tw-gap-1.5 lg:tw-gap-2.5" }, we = ["href"], Me = {
130
+ }, Me = { class: "tw-h-full tw-flex tw-items-center tw-gap-0.5 md:tw-gap-1.5 lg:tw-gap-2.5" }, ke = ["href"], ge = {
125
131
  key: 0,
126
132
  class: "tw-bg-eco-green-1 tw-py-0.5 tw-px-1 tw-text-eco-green-4"
127
- }, ke = ["href"];
128
- function ge(v, e, t, n, K, O) {
129
- const g = h("kv-material-icon"), f = h("KvHeaderDropdownLink"), I = h("kv-icon-bag"), T = h("KvUserAvatar"), a = J("kv-track-event");
130
- return i(), m("div", fe, [
131
- s((i(), m("button", {
133
+ }, be = ["href"];
134
+ function he(u, n, t, e, K, O) {
135
+ const g = h("kv-material-icon"), f = h("KvHeaderDropdownLink"), I = h("kv-icon-bag"), T = h("KvUserAvatar"), i = Q("kv-track-event");
136
+ return r(), s("div", Me, [
137
+ v((r(), s("button", {
132
138
  ref: "menuButton",
133
139
  class: p(["header-link tw-inline-flex md:tw-hidden", {
134
- "tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvHeaderMobileMenu
140
+ "tw-text-tertiary": t.openMenuItem && t.openMenuItem !== e.KvHeaderMobileMenu
135
141
  }]),
136
- onMouseover: e[0] || (e[0] = (o) => n.handleOnHover("menuButton", n.KvHeaderMobileMenu)),
137
- onMouseout: e[1] || (e[1] = (o) => n.handleMouseOut("menuButton")),
138
- onTouchstart: e[2] || (e[2] = (o) => n.handleTouchStart("menuButton", n.KvHeaderMobileMenu))
142
+ onMouseover: n[0] || (n[0] = (o) => e.handleOnHover("menuButton", e.KvHeaderMobileMenu)),
143
+ onMouseout: n[1] || (n[1] = (o) => e.handleMouseOut("menuButton")),
144
+ onTouchstart: n[2] || (n[2] = (o) => e.handleTouchStart("menuButton", e.KvHeaderMobileMenu))
139
145
  }, [
140
- D(g, { icon: n.mdiMenu }, null, 8, ["icon"])
146
+ C(g, { icon: e.mdiMenu }, null, 8, ["icon"])
141
147
  ], 34)), [
142
- [a, t.openMenuItem === n.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
148
+ [i, t.openMenuItem === e.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
143
149
  ]),
144
- s((i(), w(f, {
150
+ v((r(), w(f, {
145
151
  class: "tw-py-1",
146
152
  "ref-name": "lendButton",
147
- href: n.lendUrl,
148
- "menu-component": n.KvLendMenu,
153
+ href: e.lendUrl,
154
+ "menu-component": e.KvLendMenu,
149
155
  "open-menu-item": t.openMenuItem,
150
- "dropdown-icon": n.mdiChevronDown,
156
+ "dropdown-icon": e.mdiChevronDown,
151
157
  "base-class": "tw-inline-flex md:tw-border md:tw-rounded-md tw-px-1.5 tw-py-1",
152
- onOnHover: n.handleOnHover,
153
- onMouseout: e[3] || (e[3] = (o) => n.handleMouseOut("lendButton")),
154
- onTouchstart: e[4] || (e[4] = (o) => n.handleTouchStart("lendButton", n.KvLendMenu))
158
+ onOnHover: e.handleOnHover,
159
+ onMouseout: n[3] || (n[3] = (o) => e.handleMouseOut("lendButton")),
160
+ onTouchstart: n[4] || (n[4] = (o) => e.handleTouchStart("lendButton", e.KvLendMenu))
155
161
  }, {
156
- default: L(() => e[10] || (e[10] = [
162
+ default: L(() => n[10] || (n[10] = [
157
163
  M(" Lend ")
158
164
  ])),
159
165
  _: 1
160
166
  }, 8, ["href", "menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
161
- [a, ["TopNav", "click-Lend"]]
167
+ [i, ["TopNav", "click-Lend"]]
162
168
  ]),
163
- s((i(), w(f, {
169
+ v((r(), w(f, {
164
170
  "ref-name": "takeActionButton",
165
171
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
166
- "menu-component": n.KvHeaderTakeActionMenu,
172
+ "menu-component": e.KvHeaderTakeActionMenu,
167
173
  "open-menu-item": t.openMenuItem,
168
- "dropdown-icon": n.mdiChevronDown,
174
+ "dropdown-icon": e.mdiChevronDown,
169
175
  "send-link-position": "",
170
- onOnHover: n.handleOnHover,
171
- onMouseout: e[5] || (e[5] = (o) => n.handleMouseOut("takeActionButton"))
176
+ onOnHover: e.handleOnHover,
177
+ onMouseout: n[5] || (n[5] = (o) => e.handleMouseOut("takeActionButton"))
172
178
  }, {
173
- default: L(() => e[11] || (e[11] = [
179
+ default: L(() => n[11] || (n[11] = [
174
180
  M(" Take action ")
175
181
  ])),
176
182
  _: 1
177
183
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
178
- [a, ["TopNav", "click-TakeAction"]]
184
+ [i, ["TopNav", "click-TakeAction"]]
179
185
  ]),
180
- s((i(), w(f, {
186
+ v((r(), w(f, {
181
187
  "ref-name": "aboutUsLink",
182
188
  "data-testid": "header-about",
183
189
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
184
- "menu-component": n.KvHeaderAboutMenu,
190
+ "menu-component": e.KvHeaderAboutMenu,
185
191
  "open-menu-item": t.openMenuItem,
186
- "dropdown-icon": n.mdiChevronDown,
192
+ "dropdown-icon": e.mdiChevronDown,
187
193
  "send-link-position": "",
188
- onOnHover: n.handleOnHover,
189
- onMouseout: e[6] || (e[6] = (o) => n.handleMouseOut("aboutUsLink"))
194
+ onOnHover: e.handleOnHover,
195
+ onMouseout: n[6] || (n[6] = (o) => e.handleMouseOut("aboutUsLink"))
190
196
  }, {
191
- default: L(() => e[12] || (e[12] = [
197
+ default: L(() => n[12] || (n[12] = [
192
198
  M(" About ")
193
199
  ])),
194
200
  _: 1
195
201
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
196
- [a, ["TopNav", "click-About"]]
202
+ [i, ["TopNav", "click-About"]]
197
203
  ]),
198
- e[15] || (e[15] = C("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
199
- t.loggedIn ? s((i(), m("a", {
204
+ n[15] || (n[15] = E("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
205
+ t.loggedIn ? v((r(), s("a", {
200
206
  key: 0,
201
207
  ref: "dashboardLink",
202
208
  href: t.myDashboardUrl,
203
209
  class: p(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
204
- }, e[13] || (e[13] = [
210
+ }, n[13] || (n[13] = [
205
211
  M(" My dashboard ")
206
- ]), 10, we)), [
207
- [a, ["TopNav", "click-Dashboard"]]
212
+ ]), 10, ke)), [
213
+ [i, ["TopNav", "click-Dashboard"]]
208
214
  ]) : y("", !0),
209
- s((i(), m("a", {
215
+ v((r(), s("a", {
210
216
  ref: "basketLink",
211
217
  href: "/basket",
212
218
  class: p(["header-link tw-relative md:!tw-mr-0", { "tw-text-tertiary": !!t.openMenuItem }]),
213
219
  style: { "margin-right": "2px" },
214
220
  "data-testid": "header-basket"
215
221
  }, [
216
- D(I, {
222
+ C(I, {
217
223
  class: "tw-w-3 tw-h-3 tw-pointer-events-none",
218
224
  count: t.basketCount
219
225
  }, null, 8, ["count"])
220
226
  ], 2)), [
221
- [Q, t.basketCount > 0],
222
- [a, ["TopNav", "click-Basket"]]
227
+ [X, t.basketCount > 0],
228
+ [i, ["TopNav", "click-Basket"]]
223
229
  ]),
224
- C("div", {
230
+ E("div", {
225
231
  class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-py-1.5",
226
- onMouseover: e[7] || (e[7] = (...o) => n.handleAvatarMenuPosition && n.handleAvatarMenuPosition(...o)),
227
- onMouseout: e[8] || (e[8] = (o) => n.handleMouseOut(n.AVATAR_MENU_ID)),
228
- onTouchstart: e[9] || (e[9] = (o) => n.handleTouchStart(n.AVATAR_MENU_ID))
232
+ onMouseover: n[7] || (n[7] = (...o) => e.handleAvatarMenuPosition && e.handleAvatarMenuPosition(...o)),
233
+ onMouseout: n[8] || (n[8] = (o) => e.handleMouseOut(e.AVATAR_MENU_ID)),
234
+ onTouchstart: n[9] || (n[9] = (o) => e.handleTouchStart(e.AVATAR_MENU_ID))
229
235
  }, [
230
- t.loggedIn ? (i(), m("span", Me, X(n.numeral(t.balance).format("$0")), 1)) : y("", !0),
231
- t.loggedIn ? (i(), m(Y, { key: 1 }, [
232
- t.lenderImageUrl ? (i(), w(T, {
236
+ t.loggedIn ? (r(), s("span", ge, Y(e.numeral(t.balance).format("$0")), 1)) : y("", !0),
237
+ t.loggedIn ? (r(), s(Z, { key: 1 }, [
238
+ e.isLegacyPlaceholderAvatar(e.avatarFilename) || !e.avatarFilename ? (r(), w(g, {
233
239
  key: 0,
240
+ icon: e.mdiAccountCircle,
241
+ class: "tw-w-3"
242
+ }, null, 8, ["icon"])) : (r(), w(T, {
243
+ key: 1,
234
244
  ref: "avatar",
235
245
  "lender-name": t.lenderName,
236
246
  "lender-image-url": t.lenderImageUrl,
237
247
  "is-small": ""
238
- }, null, 8, ["lender-name", "lender-image-url"])) : (i(), w(g, {
239
- key: 1,
240
- icon: n.mdiAccountCircle,
241
- class: "tw-w-3"
242
- }, null, 8, ["icon"]))
248
+ }, null, 8, ["lender-name", "lender-image-url"]))
243
249
  ], 64)) : y("", !0)
244
250
  ], 32),
245
- t.loggedIn ? y("", !0) : s((i(), m("a", {
251
+ t.loggedIn ? y("", !0) : v((r(), s("a", {
246
252
  key: 1,
247
253
  ref: "signInLink",
248
254
  href: t.loginUrl,
249
255
  class: p(["header-link", { "tw-text-tertiary": !!t.openMenuItem }])
250
- }, e[14] || (e[14] = [
256
+ }, n[14] || (n[14] = [
251
257
  M(" Sign in ")
252
- ]), 10, ke)), [
253
- [a, ["TopNav", "click-Sign-in"]]
258
+ ]), 10, be)), [
259
+ [i, ["TopNav", "click-Sign-in"]]
254
260
  ])
255
261
  ]);
256
262
  }
257
- const Ke = /* @__PURE__ */ ue(ce, [["render", ge], ["__scopeId", "data-v-6728d6d1"]]);
263
+ const Ne = /* @__PURE__ */ me(we, [["render", he], ["__scopeId", "data-v-69cf3729"]]);
258
264
  export {
259
- Ke as default
265
+ Ne as default
260
266
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.53.0",
3
+ "version": "6.53.1",
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": "2b9e0fbf9f13fbb0a104e9176adaf18765af5c43"
117
+ "gitHead": "8172db9b0ff00fa18f38523c726e40c016e0a3e2"
118
118
  }